-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.vim
executable file
·59 lines (50 loc) · 1.78 KB
/
init.vim
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
call plug#begin('~/.vim/plugged')
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'scrooloose/nerdtree'
Plug 'majutsushi/tagbar'
Plug 'ludovicchabant/vim-gutentags'
Plug 'xolox/vim-misc'
Plug 'Raimondi/delimitMate'
Plug 'leafgarland/typescript-vim'
Plug 'altercation/vim-colors-solarized'
function! DoRemote(arg)
UpdateRemotePlugins
endfunction
Plug 'Shougo/deoplete.nvim', { 'do': function('DoRemote') }
Plug 'ternjs/tern_for_vim', { 'do': 'npm install' }
call plug#end()
autocmd BufNewFile,BufRead *.ts setlocal filetype=typescript
set background=dark
colorscheme solarized
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
set number
nnoremap \\ :noh<return>
map <C-n> :NERDTreeToggle<CR>
map <C-p> :FZF<CR>
map <F9> :so $MYVIMRC<CR>
nmap <F8> :TagbarToggle<CR>
let g:deoplete#enable_at_startup = 1
" <CR>: If popup menu visible, expand snippet or close popup with selection,
" Otherwise, check if within empty pair and use delimitMate.
imap <silent><expr><CR> pumvisible() ?
\ deoplete#mappings#close_popup()
\ : (delimitMate#WithinEmptyPair() ? "\<Plug>delimitMateCR" : "\<CR>")
" <Tab> completion:
" 1. If popup menu is visible, select and insert next item
" 2. Otherwise, if within a snippet, jump to next input
" 3. Otherwise, if preceding chars are whitespace, insert tab char
" 4. Otherwise, start manual autocomplete
imap <silent><expr><Tab> pumvisible() ? "\<C-n>"
\ : (<SID>is_whitespace() ? "\<Tab>"
\ : deoplete#mappings#manual_complete())
smap <silent><expr><Tab> pumvisible() ? "\<C-n>"
\ : (<SID>is_whitespace() ? "\<Tab>"
\ : deoplete#mappings#manual_complete())
inoremap <expr><S-Tab> pumvisible() ? "\<C-p>" : "\<C-h>"
function! s:is_whitespace() "{{{
let col = col('.') - 1
return ! col || getline('.')[col - 1] =~? '\s'
endfunction "}}}