-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
126 lines (100 loc) · 2.21 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
" Setup for pathogen plugin manager
execute pathogen#infect()
filetype plugin indent on
""""""""""
" Colors "
""""""""""
syntax on
colorscheme jerokai
"""""""""""
" Options "
"""""""""""
set number
set autoread
set showmatch
set visualbell
set autoindent
set smartindent
set shiftwidth=2
set tabstop=2
set softtabstop=2
set expandtab
set ruler
set backspace=eol,start,indent
set whichwrap+=<,>,h,l
set ignorecase
set smartcase
set hlsearch
set incsearch
set cursorline
set nowrap
set splitbelow
set splitright
set breakindent
set emoji
set wildmenu
set relativenumber
set fixendofline
set complete=.,w,b,u,i
""""""""""
" Remaps "
""""""""""
let mapleader=" "
imap jj <ESC>
nmap , <C-w><C-w>
imap <tab> <C-n>
" Copy relative file path to unnamed register
nmap <Leader>c :let @* = expand("%:.")<CR>
" This is so I don't accidentally scroll into oblivion
" Scrolling sends an up or down command to vim
map <up> <nop>
map <down> <nop>
imap <up> <nop>
imap <down> <nop>
nmap <Leader>t :tabedit<CR>
nmap <Leader>y "*yw
nmap <Leader>yy "*yy
nmap <Leader>r :set relativenumber<CR>
nmap <Leader>R :set norelativenumber<CR>
" Search for visual selection
vnoremap * y/<C-R>"<CR>
vnoremap # y/<C-R>"<CR>
" Repeat command in visual mode
vnoremap . :normal.<CR>
""""""""""""
" Commands "
""""""""""""
" Re-wrap entire file
command! Wrap normal mwgggqG`w
" Trip all trailing whitespace before writing buffer
function! TrimWhiteSpace()
%s/\s\+$//e
endfunction
autocmd BufWritePre * :call TrimWhiteSpace()
" Reload vimrc after writing to vimrc
autocmd! BufWritePost .vimrc source ~/.vimrc
" Add spell checking for git commits
autocmd Filetype gitcommit setlocal spell
set colorcolumn=81
" Yank entire buffer to system clipboard
command! Yall 0,$y *
"""""""""""""""""""
" Plugin-specific "
"""""""""""""""""""
" FZF fuzzy finding
set rtp+=/usr/local/opt/fzf
nmap <Leader>f :FZF<CR>
" Add matchit plugin
runtime macros/matchit.vim
nmap <Leader>n :NERDTree<CR>
augroup VimCSS3Syntax
autocmd!
autocmd FileType css setlocal iskeyword+=-
autocmd FileType scss setlocal iskeyword+=-
augroup END
call camelcasemotion#CreateMotionMappings('<leader>')
"""""""""""""""
" Autocorrect "
"""""""""""""""
iab credentails credentials
iab cateogry category