-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.vim
131 lines (104 loc) · 3.15 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
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
set shell=/bin/zsh
set tabstop=2
set shiftwidth=2
set smarttab
set expandtab
set novisualbell
set noerrorbells
set wildignore+=*.o,*.obj,.git,*.pyc,log,tmp,*.jpg,*.png,*.gif
set title
" We dont need no stinkin' backup or swap files. We use git!
set nobackup
set noswapfile
" Use the system clipboard
set clipboard=unnamedplus
" Custom shortcuts
nmap <leader>ss :setlocal spell!<cr>
nmap <space> :noh<cr>
" Format paragraphs quickly
vmap Q gq
nmap Q gqap
" Sudo save me a file (and make me a sandwich)
cmap w!! w !sudo tee % >/dev/null
" Some useful things
nmap <leader>rr :checktime<CR>
nmap <leader>rd :redraw!<cr>
nmap <leader>ev :e ~/dotfiles/init.vim<cr>
nmap <leader>sd <Plug>DashSearch
nmap <leader>gd <Plug>DashGlobalSearch
nmap <leader>tp :silent !thyme -d<cr> :redraw!<cr>
nmap <leader>tb :silent !thyme -db<cr> :redraw!<cr>
nmap <leader>rv :so $MYVIMRC<cr>
" Strip whitespace from certain file types
autocmd FileType c,cpp,java,php,rb,coffee,erb,slim,js,scss,css autocmd BufWritePre <buffer> :%s/\s\+$//e
" For conceal markers.
if has('conceal')
set conceallevel=2 concealcursor=niv
endif
set verbosefile=~/.vim.verbose.log
" Pligins
call plug#begin('~/.local/share/nvim/plugged')
" General Plugins
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'scrooloose/nerdcommenter'
Plug 'chriskempson/base16-vim'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'neomake/neomake'
Plug 'raimondi/delimitmate'
Plug 'mbbill/undotree'
Plug 'Chiel92/vim-autoformat'
" UI
Plug 'nathanaelkane/vim-indent-guides'
Plug 'airblade/vim-gitgutter'
" Autocompletion
Plug 'Shougo/deoplete.nvim'
Plug 'mhartington/nvim-typescript'
Plug 'ternjs/tern_for_vim'
" Syntax Plugins
Plug 'digitaltoad/vim-pug'
Plug 'vim-javascript'
Plug 'vim-coffee-script'
Plug 'vim-ruby/vim-ruby'
Plug 'rails.vim'
Plug 'othree/html5.vim'
Plug 'JSON.vim'
Plug 'plasticboy/vim-markdown'
Plug 'hail2u/vim-css3-syntax'
Plug 'cakebaker/scss-syntax.vim'
Plug 'leafgarland/typescript-vim'
Plug 'slim-template/vim-slim'
Plug 'posva/vim-vue'
call plug#end()
" Colors
set termguicolors
colorscheme base16-default-dark
let base16colorspace=256
set background=dark
set listchars=tab:▸\ ,eol:¬
set list
" # Syntax Checking
autocmd! BufWritePost * Neomake
" # Deoplete Autocompletion
let g:deoplete#enable_at_startup = 1
let g:deoplete#enable_smart_case = 1
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : deoplete#mappings#manual_complete()
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
" prevent preview window
set completeopt-=preview
" # File search and navigation: neovim-fuzzy
"
nmap <C-e> :NERDTreeToggle<cr>
nnoremap <C-p> :FZF<cr>
" # NERDCommenter Commenting
"
" Add spaces after comment delimiters by default
let g:NERDSpaceDelims = 1
" Use compact syntax for prettified multi-line comments
let g:NERDCompactSexyComs = 1
" Align line-wise comment delimiters flush left instead of following code indentation
let g:NERDDefaultAlign = 'left'
" Allow commenting and inverting empty lines (useful when commenting a region)
let g:NERDCommentEmptyLines = 1
" Enable trimming of trailing whitespace when uncommenting
let g:NERDTrimTrailingWhitespace = 1
let g:autoformat_verbosemode=1