-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
149 lines (119 loc) · 4.93 KB
/
Copy pathvimrc
File metadata and controls
149 lines (119 loc) · 4.93 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
set nocompatible
" ================= PLUGINS ==========================
source $HOME/.vimrc-plugins
" ================= GENERAL ==========================
set number "Line numbers are good
set backspace=indent,eol,start "Allow backspace in insert mode
set history=100 "Store lots of :cmdline history
set showcmd "Show incomplete cmds down the bottom
set showmatch "Do matching brackets
set smartcase "Do smart case matching
set autoread "Reload files changed outside vim
set wrap "Soft Wrapping text (fit within window size)
set encoding=utf-8 "Standard encoding to UTF-8
set ffs=unix,dos,mac "Unix as the standard filetype
set laststatus=2 "Set statusline = 2
set noshowmode "Show current mode down the bottom (vim-airline)
set colorcolumn=80
set cinoptions=t0
set hidden "Hide buffers in background
set lazyredraw "Buffer screen update
set linebreak "Wrap lines at convenient points
set list "Enable listchars
set listchars=tab:\ \ ,trail:· "Set trails for tabs and spaces
"" Disable bells
set noerrorbells
set novisualbell
set tm=500
autocmd VimEnter * set vb t_vb=
let g:tex_flavor = "latex" "Latex favor
" ================= TURN OFF SWAP FILES ==============
set noswapfile
set nobackup
set nowb
" ================= INDENTATION ======================
set autoindent "Auto indent
set smartindent "Smart indent
set expandtab "Use spaces instead of tabs
set smarttab
set shiftwidth=4 "1 tab == 4 spaces
set softtabstop=4
set tabstop=4
set cindent
"Setting makefiles with tabs, not spaces
autocmd FileType make setlocal noexpandtab
" ================ CURSOR =============================
au BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
" Enable cursorline
augroup CursorLine
au!
au VimEnter,WinEnter,BufWinEnter * setlocal cursorline
au WinLeave * setlocal nocursorline
augroup END
" ================= SEARCH ===========================
set ignorecase "Ignore case when searching
set incsearch "Find the next match as we type the search
set hlsearch "Hilight searches by default
nnoremap <esc><esc> :silent! nohlsearch<cr>
"Double ESC to disable hilight searches
" ================= FOLDS ============================
set foldmethod=indent "Fold based on indent
set nofoldenable "Dont fold by default
" ================= COPY PASTE =======================
if system('uname -s') == "Darwin\n"
set clipboard=unnamed "Mac OSX
else
set clipboard=unnamedplus "Linux
endif
" ================= FANCY COLORS =====================
"Enable full color supported
silent set termguicolors
if &term =~# '^screen'
silent let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
silent let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
endif
if !has('gui_running')
set t_Co=256
endif
set background=dark "Set background dark
"let g:python_highlight_all = 1 "Enable python syntax highlight
silent colorscheme molokai "Set default theme
" Set color for error and warning signs
silent hi clear ALEErrorSign
silent hi clear ALEWarningSign
silent hi ALEErrorSign ctermbg=NONE ctermfg=red guifg=#FF0000
silent hi ALEWarningSign ctermbg=NONE ctermfg=white guifg=#FFFFFF
autocmd FileType tex,latex
\ set background=dark |
\ colorscheme molokai |
\ set spell
autocmd FileType sh colorscheme luna
function! SetColor()
"Highlight specific colors
"normal color
"hi Normal ctermbg=233 guibg=#1e1e1e ctermfg=255 guifg=#FFFFFF
"line number
"hi LineNr ctermbg=NONE guibg=NONE ctermfg=240 guifg=#585858
"selected code color (visual)
"hi Visual ctermbg=25 guibg=#1A49A5 ctermfg=15 guifg=#FFFFFF
"autocomplete menu color
hi Pmenu ctermbg=235 guibg=#333333 ctermfg=NONE guifg=NONE
hi PmenuSel ctermfg=15 guifg=#FFFFFF ctermbg=25 guibg=#1A49A5
hi PmenuSbar ctermfg=15 guifg=#FFFFFF ctermbg=245 guibg=#8a8a8a
hi PmenuThumb ctermfg=15 guifg=#FFFFFF ctermbg=25 guibg=#1A49A5
" hi Pmenu ctermbg=235 guibg=#2e3134 ctermfg=NONE guifg=NONE
" hi PmenuSel ctermfg=25 guifg=#1f6ad7 ctermbg=237 guibg=#46494c
" hi PmenuSbar ctermfg=15 guifg=#FFFFFF ctermbg=245 guibg=#8a8a8a
" hi PmenuThumb ctermfg=15 guifg=#FFFFFF ctermbg=25 guibg=#1A49A5
"column color (right)
hi ColorColumn ctermbg=236 guibg=#303030 ctermfg=255 guifg=#FFFFFF
"search keyword
hi Search ctermbg=220 guibg=#FFD700 ctermfg=16 guifg=#000000
"cursorline
hi CursorLine ctermbg=235 guibg=#333333 cterm=NONE gui=NONE
hi CursorLineNR ctermfg=208 guifg=#ff8700 ctermbg=NONE guibg=NONE
endfunction
autocmd FileType * call SetColor()