-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
123 lines (110 loc) · 3.52 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
syntax on
set nocompatible
set number
set splitbelow
set splitright
set cursorline
set backspace=indent,eol,start
call plug#begin('~/.vim/plugged')
Plug 'vim-ruby/vim-ruby'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-rails'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-commentary'
Plug 'mhinz/vim-signify'
Plug 'itchyny/lightline.vim'
Plug 'scrooloose/nerdtree'
Plug 'scrooloose/syntastic'
Plug 'morhetz/gruvbox'
Plug 'sheerun/vim-wombat-scheme'
call plug#end()
filetype plugin indent on
"Put your non-Plugin stuff after this line
set laststatus=2
set noshowmode
let g:lightline = {
\ 'colorscheme': 'wombat',
\ 'active': {
\ 'left': [ ['mode', 'paste'],
\ ['fugitive', 'readonly', 'filename', 'modified'] ],
\ 'right': [ [ 'lineinfo' ], ['percent'] ]
\ },
\ 'component': {
\ 'readonly': '%{&filetype=="help"?"":&readonly?"🔒":""}',
\ 'modified': '%{&filetype=="help"?"":&modified?"+":&modifiable?"":"-"}',
\ 'fugitive': '%{exists("*fugitive#head")?fugitive#head():""}'
\ },
\ 'component_visible_condition': {
\ 'readonly': '(&filetype!="help"&& &readonly)',
\ 'modified': '(&filetype!="help"&&(&modified||!&modifiable))',
\ 'fugitive': '(exists("*fugitive#head") && ""!=fugitive#head())'
\ },
\ 'separator': { 'left': ' ', 'right': ' ' },
\ 'subseparator': { 'left': ' ', 'right': ' ' }
\ }
"Sysntastically
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 0
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 1
let g:syntastic_enable_balloons = 1
"Tab Settings
set tabstop=2 "show existing tab with 2 spaces width "
set shiftwidth=2 "when indenting with '>', use 2 spaces width "
set expandtab "Change tabs to spaces "
set smartindent
"Disable swap file"
set noswapfile
"Keep at least 3 lines above/below"
set scrolloff=3
set lazyredraw
"Search Settings
set incsearch "Show immediately where the so-far typed pattern matches."
set hlsearch "Highlight search term"
"Always show the status of the file"
set laststatus=2
"jk is escape"
inoremap jk <esc>
map <silent> <C-n> :NERDTreeToggle<CR>
map <F3> :noh<CR>
map <F5> :setlocal spell! spelllang=en_us<CR>
map <F6> :%!python -m json.tool<CR>
map <F7> gg=G<C-o><C-o>
let os = substitute(system('uname'), '\n', '', '')
if os == "Linux"
if !has('gui_running')
set t_Co=256
endif
colorscheme wombat
"Signify
highlight SignColumn ctermbg=NONE cterm=NONE guibg=NONE gui=NONE
" highlight lines in Sy and vimdiff etc.)
highlight DiffAdd cterm=bold ctermbg=none ctermfg=119
highlight DiffDelete cterm=bold ctermbg=none ctermfg=167
highlight DiffChange cterm=bold ctermbg=none ctermfg=227
" highlight signs in Sy
highlight SignifySignAdd cterm=bold ctermbg=237 ctermfg=119
highlight SignifySignDelete cterm=bold ctermbg=237 ctermfg=167
highlight SignifySignChange cterm=bold ctermbg=237 ctermfg=227
elseif os == "Darwin"
set background=dark
let g:solarized_termcolors=256
colorscheme gruvbox
set termguicolors
end
" Strip trailing whitespace
function! <SID>StripTrailingWhitespaces()
" Preparation: save last search, and cursor position.
let _s=@/
let l = line(".")
let c = col(".")
" Do the business:
%s/\s\+$//e
" Clean up: restore previous search history, and cursor position
let @/=_s
call cursor(l, c)
endfunction
autocmd BufWritePre * :call <SID>StripTrailingWhitespaces()