-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
106 lines (81 loc) · 2.44 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
execute pathogen#infect()
" My personal vimrc file"
" Created August 05, 2013"
" set tabs to 2 spaces"
set smartindent
set expandtab
set tabstop=2
set shiftwidth=2
" set linenumbering
set number
set numberwidth=5
syntax on
set nowrap
" relative line numbering on
set relativenumber
" relative / absolute line numbering switch
" http://jeffkreeftmeijer.com/2012/relative-line-numbers-in-vim-for-super-fast-movement
function! NumberToggle()
if(&relativenumber == 1)
set number
else
set relativenumber
endif
endfunc
nnoremap <C-n> :call NumberToggle()<cr>
:au FocusLost * :set number
:au FocusGained * :set relativenumber
autocmd InsertEnter * :set number
autocmd InsertLeave * :set relativenumber
" highlight search results
set hlsearch
set showcmd " display incomplete commands "
set laststatus=2 " always display the status line "
" filename and file information
set statusline=%t "tail of the filename
" :set statusline+=[%{strlen(&fenc)?&fenc:'none'}, "file encoding
set statusline+=%{&ff}] "file format
set statusline+=%h "help file flag
set statusline+=%m "modified flag
set statusline+=%r "read only flag
set statusline+=%y "filetype
set statusline+=%= "left/right separator
set statusline+=%c, "cursor column
set statusline+=%l/%L "cursor line/total lines
set statusline+=\ %P "percent through file
" remap tab keys "
map tn :tabnext<CR>
map tp :tabprevious<CR>
noremap :te :tabedit
" move faster with hjkl "
nmap J 5j
nmap K 5k
xmap J 5j
xmap K 5k
" move even faster with hjkl
xmap <C-j> 50j
" format json
nmap =j :%!python -m json.tool<CR>
" add support for twig through jinja.vim and htmljinja.vim "
au BufRead,BufNewFile *.twig set filetype=htmljinja
" split treating "
set splitbelow
set splitright
"##############################################################################
" Easier split navigation
"##############################################################################
" Use ctrl-[hjkl] to select the active split!
nmap <silent> <c-k> :wincmd k<CR>
nmap <silent> <c-j> :wincmd j<CR>
nmap <silent> <c-h> :wincmd h<CR>
nmap <silent> <c-l> :wincmd l<CR>
let g:molokai_original = 1
" let g:rehash256 = 1
" fuzzy search with ctrl-p
set runtimepath^=~/.vim/bundle/ctrlp.vim
" set colorscheme to vividchalk, theme resides in the ~/.vim/colors folder
:colorscheme vividchalk
" set line number bar colors
highlight LineNr ctermfg=grey ctermbg=black
" we need more custom colors
hi htmlEqualSign guifg=red