-
Notifications
You must be signed in to change notification settings - Fork 0
/
_vimrc
144 lines (120 loc) · 3.06 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
" Pathogen
execute pathogen#infect()
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
set diffexpr=MyDiff()
function! MyDiff()
let opt = '-a --binary '
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
let arg1 = v:fname_in
if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
let arg2 = v:fname_new
if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
let arg3 = v:fname_out
if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
let eq = ''
if $VIMRUNTIME =~ ' '
if &sh =~ '\<cmd'
let cmd = '""' . $VIMRUNTIME . '\diff"'
let eq = '"'
else
let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
endif
else
let cmd = $VIMRUNTIME . '\diff'
endif
silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction
syntax on
filetype plugin indent on
" Mapleader
let mapleader = ','
if has('gui_running')
set guifont=Consolas:h11
" Hide unneccessary GUI stuff
set guioptions-=m
set guioptions-=T
set guioptions-=r
set guioptions-=L
endif
set background=dark
colorscheme molokai
set autoread
set nobackup
set nowb
set noswapfile
set nowrap
set expandtab
set smarttab
set shiftwidth=4
set tabstop=4
set ruler
set number
set backspace=eol,start,indent
set ignorecase
set smartcase
set hlsearch
set lazyredraw " no redraw while executing macros
set showmatch " show matching brackets
set noerrorbells
set visualbell
syntax enable
set encoding=utf8
set ai " Auto indent
set si " Smart indent
set laststatus=2
" emmet
let g:user_emmet_leader_key ='<c-y>'
" Paste
set pastetoggle=<F2>
" SuperTab
let g:SuperTabMappingForward = '<c-space>'
let g:SuperTabMappingBackward = '<s-c-space>'
let g:SuperTabDefaultCompletionType = "<c-n>"
" CtrlP
let g:ctrlp_map = '<C-P>'
let g:ctrlp_cmd = 'CtrlP'
" map <F4> :CtrlP<CR>
" NERDTree
map <F4> :NERDTreeToggle<CR>
map <leader>f :NERDTreeFind<CR>
" Some mappings
map <leader>rr :source $VIM\_vimrc<CR>
map <leader>/ :set hlsearch!<CR>
map <leader>ev :e $VIM\_vimrc<CR>
map <leader>eh :e C:\Windows\System32\drivers\etc\hosts<CR>
noremap š ^
noremap đ $
noremap ž 0
noremap - :
map <C-J> <C-W>j
map <C-K> <C-W>k
map <C-H> <C-W>h
map <C-L> <C-W>l
map <leader>tn :tabnew<CR>
map <leader>tc :tabclose<CR>
map <leader>te :tabedit <c-r>=expand("%:p:h")<cr>/
map <leader>= :Tabularize /=<CR>
" Switchbuf behavious
try
set switchbuf=useopen,usetab,newtab
set stal=2
catch
endtry
" Status line
" set statusline=%t "tail of the filename
set statusline=%f
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+=\ (filetype:\ %y) "filetype
set statusline+=\ %c: "cursor column
set statusline+=%l\ (%L\ Total) "cursor line/total lines
set statusline+=\ %P "percent through file
set statusline+=%=
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}