-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
executable file
·104 lines (82 loc) · 2.12 KB
/
vimrc
File metadata and controls
executable file
·104 lines (82 loc) · 2.12 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
set nocompatible
set autoindent
set hlsearch
set incsearch
set number
set cursorline
set showmatch
set tabstop=2
set softtabstop=2
set shiftwidth=2
set noexpandtab
set t_Co=256
set visualbell
set noerrorbells
set nobackup
set noswapfile
set mouse=a
" https://tutsplus.com/lesson/a-few-more-vim-settings/
set scrolloff=10
set linebreak
set wildmenu
set undofile
onoremap w iw
nnoremap j gj
nnoremap k gk
nnoremap 0 g0
nnoremap $ g$
" END https://tutsplus.com/lesson/a-few-more-vim-settings/
" STATUS LINE ON STEROIDS
" https://github.com/vgod/vimrc/blob/master/vimrc
set laststatus=2
set statusline=\ %{HasPaste()}%<%-15.25(%f%)%m%r%h\ %w\ \
set statusline+=\ \ \ [%{&ff}/%Y]
set statusline+=\ \ \ %<%20.30(%{hostname()}:%{CurDir()}%)\
set statusline+=%=%-10.(%l,%c%V%)\ %p%%/%L
let mapleader = ","
call pathogen#infect()
:colorscheme molokai
syntax enable
filetype plugin on
filetype indent on
"if has('autocmd')
"endif
nmap <C-V> "+gP
imap <C-V> <ESC><C-V>
vmap <C-C> "+y
map <f2> :NERDTreeToggle<CR>
inoremap <leader><tab> <C-X><C-O>
" No array keys, brah
noremap <left> <nop>
noremap <right> <nop>
noremap <up> <nop>
noremap <down> <nop>
" SUPER RETAB
" For converting indented spaces to tabs
" To use: visually select block, then enter Tab2Space or Space2Tab as commands
" Source: http://vim.wikia.com/wiki/Super_retab
:command! -range=% -nargs=0 Tab2Space execute "<line1>,<line2>s/^\\t\\+/\\=substitute(submatch(0), '\\t', repeat(' ', ".&ts."), 'g')"
:command! -range=% -nargs=0 Space2Tab execute "<line1>,<line2>s/^\\( \\{".&ts."\\}\\)\\+/\\=substitute(submatch(0), ' \\{".&ts."\\}', '\\t', 'g')"
" COLOR column and preveting code wrapping
set tw=85 fo+=t
if exists('&colorcolumn')
set colorcolumn=+1
else
au BufWinEnter *
\ let w:m2=matchadd('ErrorMsg', '\%>85v.\+', -1)
endif
function! CurDir()
let curdir = substitute(getcwd(), $HOME, "~", "")
return curdir
endfunction
function! HasPaste()
if &paste
return '[PASTE]'
else
return ''
endif
endfunction
" From https://tutsplus.com/lesson/autocommands
" autocmd event pattern command
" Format HTML on load
autocmd BufRead,BufWritePre *.html normal gg=G