-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
78 lines (68 loc) · 1.91 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
set background=dark
set termguicolors
set number
set laststatus=2
set expandtab
set tabstop=2
set softtabstop=2
set cursorline
set colorcolumn=80
set relativenumber
set paste
set timeoutlen=0
" Plug
call plug#begin('~/.vim/plugged')
Plug 'scrooloose/nerdTree'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'chriskempson/base16-vim'
Plug 'airblade/vim-gitgutter'
Plug 'morhetz/gruvbox'
Plug 'itchyny/lightline.vim'
Plug 'joshdick/onedark.vim'
Plug 'sjl/gundo.vim'
Plug 'vimwiki/vimwiki'
call plug#end()
" Leader
let mapleader = "\\"
" Insert Remaps
inoremap jk <esc>
" Remaps
nnoremap <leader>u :GundoToggle<CR>
nnoremap <leader>n :NERDTreeToggle<CR>
nnoremap <leader>e :Explore<CR>
nnoremap <leader>p :FZF<CR>
" Autogroups
augroup configgroup
autocmd!
autocmd VimEnter * highlight clear SignColumn
autocmd BufWritePre *.php,*.py,*.js,*.txt,*.hs,*.java,*.rb,*.md
\:call <SID>StripTrailingWhitespaces()
autocmd FileType ruby setlocal tabstop=2
autocmd FileType ruby setlocal shiftwidth=2
autocmd FileType ruby setlocal softtabstop=2
autocmd FileType ruby setlocal commentstring=#\ %s
autocmd BufEnter *.zsh-theme setlocal filetype=zsh
autocmd BufEnter Makefile setlocal noexpandtab
autocmd BufEnter *.sh setlocal tabstop=2
autocmd BufEnter *.sh setlocal shiftwidth=2
autocmd BufEnter *.sh setlocal softtabstop=2
augroup END
" strips trailing whitespace at the end of files. this
" is called on buffer write in the autogroup above.
function! <SID>StripTrailingWhitespaces()
" save last search & cursor position
let _s=@/
let l = line(".")
let c = col(".")
%s/\s\+$//e
let @/=_s
call cursor(l, c)
endfunction
" NerdTree Setup
let NERDTreeShowHidden=1
" VimWiki Setup
let g:vimwiki_list = [{'path': '~/vimwiki/', 'syntax': 'markdown', 'ext': 'md'}]
" Color Scheme Setups
let g:lightline = { 'colorscheme': 'onedark' }
let g:onedark_hide_endofbuffer = 1
colorscheme onedark