-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
executable file
·98 lines (77 loc) · 2.34 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
syntax enable
colorscheme monokai
"load all the plugins
execute pathogen#infect()
syntax on
filetype plugin indent on
set omnifunc=syntaxcomplete#Complete
"gundo custom settings
let g:gundo_preview_bottom=1
let g:gundo_auto_preview=1
" allows cursor as a line/block in tmux mode
if exists('$TMUX')
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
else
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif
"leader is ',' instead of '\'
let mapleader=","
"leader for emmet expansion
let g:user_emmet_leader_key='<C-i>'
"let stuffNThings = 55
" re-map CTRL-x CTRL-o to <leader> a (auto-complete)
inoremap <leader>a <C-x><C-o>
" re-map 'jk' to <esc>
inoremap jk <esc>
"toggle gundo
nnoremap <leader>u :GundoToggle<CR>
"map <leader>f to start instering at first character
nnoremap <leader>f ^i
"show line numbers
set number
highlight LineNr ctermfg=grey ctermbg=black
"show command in bottom bar
set showcmd
"visual autocomplete for command menu
set wildmenu
"search as characters are entered
set incsearch
"highlight matches
set hlsearch
"turn of serach highlight
nnoremap <leader><space> :nohlsearch<CR>
"search default is case insensative
set ic
"tComment plugin remap CTRL+_ CTRL+_ to <leader>c
map <leader>c <C-_><C-_>
"highlight bad/trailing whitespace
highlight BadWhitespace ctermbg=red guibg=darkred
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h,*.rb match BadWhitespace /\s\+$/
au BufNewFile,BufRead *.py set tabstop=4 softtabstop=4 shiftwidth=4 textwidth=119 expandtab autoindent fileformat=unix
"set the scroll buffer (lines shown above/below cursor)
set scrolloff=5
"working with splits
set splitright
nnoremap <C-H> <C-W><C-H>
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
"set spellcheck on by default"
"set spell
"set tab auto-indentation to spaces
set expandtab
set shiftwidth=2
set softtabstop=2
"tab navigation to resemble Vimium(ish)
nnoremap J gT
nnoremap K gt
nnoremap <C-t> :tabnew<CR>:edit
nnoremap <C-w> :tabclose<CR>
nnoremap <leader>j :tabmove-1<CR>
nnoremap <leader>k :tabmove+1<CR>
"Allow saving of files as sudo when opened a read-only file without sudo
"per:
"http://stackoverflow.com/questions/2600783/how-does-the-vim-write-with-sudo-trick-work
cmap w!! w !sudo tee > /dev/null %