-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
105 lines (98 loc) · 2.61 KB
/
vimrc
File metadata and controls
105 lines (98 loc) · 2.61 KB
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
"" .vimrc
if 0 | endif
set nocompatible
set encoding=utf-8
set backspace=indent,eol,start
filetype plugin on
filetype indent on
"" vim-plug
call plug#begin('~/.vim/plugged')
"" shorthand
Plug 'junegunn/vim-easy-align'
"" any valid git url
Plug 'https://github.com/junegunn/vim-github-dashboard.git'
"" non-master branch
""Plug 'rdnetto/ycm-generator', { 'branch': 'stable' }
"" plug-in options (tag, rtp)
Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' }
"" group deps
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
"" lazy loading
""Plug 'scrooloose/nerdtree', { 'on' : 'NERDTreeToggle' }
""Plug 'tpope/vim-fireplace', { 'for' : 'clojure' }
"" post-update hook plugs in outside ~/.vim/plugged
"" Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': '.install --all' }
"" add plug-ins to &runtimepath
call plug#end()
"" Time out on keycodes -- but not mappings
"" https://gist.github.com/mislav/5706063
set notimeout
set ttimeout
set ttimeoutlen=100
"" Search
set incsearch
set hlsearch
set ignorecase
set smartcase
"" Folding
set foldmethod=indent
set foldnestmax=10
set foldenable
nnoremap <space> za
set foldlevelstart=10
"" Space
set nowrap
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
""set autoindent
"if has('gui_running')
" set background=light
"else
" set background=dark
"endif
"colorscheme badwolf
set wildmenu
set lazyredraw
augroup configgroup
autocmd!
autocmd VimEnter * highlight clear SignColumn
autocmd BufWritePre *.php,*.py,*.js,*.txt,*.hs,*.java,*.md,*.rb :call <SID>StripTrailingWhitespaces()
autocmd BufEnter *.cls setlocal filetype=java
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.
" e.g., build programs differently named across systems:
"let g:make = 'gmake'
"if system('uname -o') =~ '^GNU/'
" let g:make = 'make'
" endif
" NeoBundle 'Shougo/vimproc.vim', {'build': {'unix': g:make}}
" highlight last inserted text
" nnoremap gV `[v`]
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
" split nav
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
set splitbelow
set splitright
" max height / width / normalize
" <C-W _ | =>
" " swap opp / breakout new tab / close others
" <C-W R T o>