-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
152 lines (132 loc) · 4.1 KB
/
vimrc
File metadata and controls
152 lines (132 loc) · 4.1 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
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
144
145
146
147
148
149
150
151
" Enable pathogen ------------------------------------------------------------
execute pathogen#infect()
syntax on
filetype plugin indent on
set nocompatible
set encoding=utf-8
function! TimeCmp(time1, time2)
let [hour1, min1] = split(a:time1, ':')
let [hour2, min2] = split(a:time2, ':')
if hour1 != hour2
return hour1 - hour2
endif
return min1 - min2
endfun
" Solarized settings
let g:solarized_termcolors=256
" Default background
set background=dark
colorscheme solarized
if !empty($VIM_DAYLIGHT_START) && !empty($VIM_DAYLIGHT_END)
if TimeCmp(strftime("%H:%M"), $VIM_DAYLIGHT_START) >= 0 && TimeCmp(strftime("%H:%M"), $VIM_DAYLIGHT_END) <= 0
set background=light
else
set background=dark
endif
end
call togglebg#map("<F5>")
" Normally to generate documentation, Vim expects you to run :helptags on each
" directory with documentation (e.g., :helptags ~/.vim/doc). Provided with
" pathogen.vim is a :Helptags command that does this on every directory in
" your 'runtimepath'. If you really want to get crazy, you could even invoke
" Helptags in your vimrc. I don't like to get crazy
" call pathogen#Helptags()
"
"
"Useful mappings -------------------------------------------------------------
" This is need by vim-airline to show up--------------------------------------
set laststatus=2
" Automatically displays all buffers when there's only one tab open.
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#left_sep = ' '
let g:airline#extensions#tabline#left_alt_sep = '|'
"
"Togge Tagbar-----------------------------------------------------------------
nmap <F8> :TagbarToggle<CR>
"
"Sensible---------------------------------------------------------------------
"Normally, sensible.vim loads after your vimrc, making it a bit tricky to
"override (although you could use after/plugin/sensible.vim). If you want to
"load it earlier, add the following line to you vimrc, then put your overrides
"below.
"
"runtime! plugin/sensible.vim
"
"
"NerdTree---------------------------------------------------------------------
nmap <C-n> :NERDTreeToggle<CR>
" Tagbar
nmap <F8> :TagbarToggle<CR>
" Next buffer
nmap <C-k> :bn<CR>
" Previous buffer
nmap <C-j> :bp<CR>
nmap <Tab>- :sp<CR>
nmap <Tab>\ :vsp<CR>
nmap <C-c> :let @/ = ""<CR>
" Set numbers
set number
set hlsearch
set incsearch
set ignorecase
"set smartcase
set smartindent
"set tabstop=4
"set shiftwidth=4
set expandtab
set hidden " switch buffers without raising an error message
set splitbelow
set splitright
set cursorline
" Set folding depending on file syntax
set foldmethod=syntax
" Do not fold by default
set nofoldenable
" Undotree mapping
nmap <F6> :UndotreeToggle<CR>
" let undotree window get focus after being opened
let g:undotree_SetFocusWhenToggle = 1
" Window layout (options: 1, 2, 3, 4)
let g:undotree_WindowLayout = 2
" vim-closetag configuration
" filenames like *.xml, *.html, *.xhtml, ...
let g:closetag_filenames = "*.html,*.xhtml,*.phtml,*.xml,*.htm"
" TypeScript-Vim: https://github.com/leafgarland/typescript-vim ==============
"
" To disable indenting
" let g:typescript_indent_disable = 1
"
" Automatically indent chained method calls as you type
setlocal indentkeys+=0.
"
" Options to change the compiler name and to insert default options
let g:typescript_compiler_binary = 'tsc'
let g:typescript_compiler_options = ''
" Make the QuickFix window automatically appear if :make has any errors
autocmd QuickFixCmdPost [^l]* nested cwindow
autocmd QuickFixCmdPost l* nested lwindow
" Syntastic: https://github.com/vim-syntastic/syntastic
" Recommended settings
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
set noerrorbells visualbell t_vb=
if has('autocmd')
autocmd GUIEnter * set visualbell t_vb=
endif
"set to 0 if you want to enable it later via :RainbowToggle
let g:rainbow_active = 1
function! PresentationMode()
colorscheme default
set noshowmode
set noruler
set noshowcmd
set nonumber
set nocursorline
set laststatus=0
set t_ut=
endfun