-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc.veezus
118 lines (107 loc) · 4.86 KB
/
.vimrc.veezus
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
set encoding=utf-8
set tw=100 " Wrap at 100 characters
set fo=cq " Don't autowrap
set incsearch " incremental search
set laststatus=2 " show a status bar at the bottom of each window
set ruler
" set list " show tabs as arrows and trailing spaces as dash
" set listchars=trail:-,extends:>,precedes:<
" set listchars=tab:>\ ,trail:-,extends:>,precedes:<
set showcmd " shows partial commands in the lower right
set showmatch " blink opening parens when closing
set wildmenu " allow tab to cycle through found options
set wildmode=list:longest
set splitbelow " open newly split file on the bottom
set splitright " open newly split file on the right
set autoread " load files that have been updated on disk
set scrolloff=5 " screen scrolls at 5 lines from top or bottom
set hlsearch " highlight search terms
hi Visual term=reverse cterm=reverse
set backspace=indent,eol,start " allow removing indents and line breaks
set visualbell
set number
set t_Co=256
" set mouse=n " only in normal mode
" Load plugin help files
:Helptags
" colors ir_black
" *line configuration
" let g:airline_theme='violet'
" let g:airline_section_b = ''
let g:lightline = {
\ 'colorscheme': 'ayu_mirage',
\ 'active': {
\ 'right': [ [ 'syntastic', 'lineinfo' ],
\ [ 'percent' ],
\ [ 'gitbranch' ] ],
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'coloredrelpath', 'readonly', 'modified' ] ],
\ },
\ 'component_function': {
\ 'gitbranch': 'FugitiveHead',
\ },
\ 'component': {
\ 'coloredrelpath': '%#Path#%{get(PathText(),0)}%#CurrentFile#%{get(PathText(),1)}'
\ }
\ }
function! PathText()
let file = split(expand('%:f'), '/')
let map = { 'V': 'n', "\<C-v>": 'n', 's': 'n', 'v': 'n', "\<C-s>": 'n', 'c': 'n', 'R': 'n'}
let mode = get(map, mode()[0], mode()[0])
"add last two chars in bgcolor to hex codes below with a 00 for darkmode
let bgcolor = {'n': [240, '#232932'], 'i': [31, '#232932']}
let color = get(bgcolor, mode, bgcolor.n)
exe printf('hi Path ctermfg=196 ctermbg=%d guifg=#5e6f7f guibg=%s term=bold cterm=bold',
\ color[0], color[1])
exe printf('hi CurrentFile ctermfg=248 ctermbg=%d guifg=#ffffff guibg=%s term=bold cterm=bold',
\ color[0], color[1])
return len(file) > 0 ? [join(file[0:-2], '/') . (len(file) == 1 ? '' : '/'), file[-1]] : ['', '[No Name]']
endfunction
\ }
let g:fold_rspec_foldenable = 1 " disables folding (toggle with `zi`)
let g:fold_rspec_foldlevel = 4 " sets initial open/closed state of all folds (open unless nested more than four levels deep)
let g:fold_rspec_default_foldcolumn = 4 " shows a 4-character column on the lefthand side of the window displaying the document's fold structure
let g:fold_rspec_foldminlines = 3 " disables closing of folds containing two lines or fewer
" let g:fold_rspec_foldclose = 'all' " closes folds automatically when the cursor is moved out of them (only applies to folds deeper than 'foldlevel')
augroup spacesovertabs
autocmd FileType c,css,eruby,gitconfig,javascript,json,haml,html,ruby,sass,scss,sh,sql,sshconfig,text,vim,vue
\ setlocal autoindent shiftwidth=2 softtabstop=2 expandtab tabstop=2
" Opening a file with no filetype
" https://stackoverflow.com/questions/46678615/how-do-you-set-an-autocmd-to-take-effect-when-filetype-is-none
autocmd BufNewFile,BufRead * if empty(&filetype) | execute 'setlocal autoindent shiftwidth=2 softtabstop=2 expandtab tabstop=2' | endif
augroup END
set autoindent shiftwidth=2 softtabstop=2 expandtab tabstop=2
" Bundle Open command, from Bernerd Schaefer
" Call with :BundleOpen <gemname>
function! s:BundleOpen(Gem) abort
if exists(':Btabedit')
execute 'Btabedit '.a:Gem
redraw
let v:warningmsg = 'Use :Btabedit instead. It has tab complete!'
echomsg v:warningmsg
return
endif
let path = system('bundle show '.a:Gem)
if v:shell_error != 0
echo 'failed to run command'
else
exe 'tabedit '.substitute(path, '\v\C\n$', '', '') | :lcd %
endif
endfunction
:command! -nargs=1 BundleOpen :call s:BundleOpen(<q-args>)
noremap <F1> <Esc>
noremap! <F1> <Esc>
" copy selected line
vmap <Leader>c :w !pbcopy<CR>
" grep for word under cursor
" nnoremap <Leader>f :grep <cword> -r app lib config features spec vendor<CR><CR><CR>
" Fuzzy find
nnoremap <Leader>f :Files<CR>
" timestamps for daily log
nmap <Leader>tg o<Esc>"=strftime("%H:%M")<CR>pa -
nmap <Leader>te 0f-l"=strftime("%H:%M")<CR>p
nmap <Leader>tu yypv$r=o
nmap <Leader>td O<Esc>"=strftime("%a, %b %d, %Y")<CR>p<Leader>tu<Esc>
" For timeless date starting
nmap <Leader>tt O<Esc>"=strftime("%a, %b %d, %Y", localtime()+86400)<CR>p<Leader>tu
source ~/.vimrc.local