update abbreviations
This commit is contained in:
parent
5f2a64b199
commit
2eb2e7f8aa
116
vimrc
116
vimrc
|
@ -164,8 +164,8 @@ let g:inline_edit_patterns = [{
|
|||
\ }]
|
||||
|
||||
let g:inline_edit_autowrite = 1
|
||||
let g:inline_edit_proxy_type = "tempfile"
|
||||
let g:inline_edit_new_buffer_command ="tabedit"
|
||||
let g:inline_edit_proxy_type = 'tempfile'
|
||||
let g:inline_edit_new_buffer_command ='tabedit'
|
||||
let g:inline_edit_modify_statusline = 0
|
||||
|
||||
nnoremap <space>ie :InlineEdit<cr>
|
||||
|
@ -224,6 +224,7 @@ nnoremap <space>pe :lprev<cr>
|
|||
let g:ale_sign_error = '>>'
|
||||
let g:ale_sign_warning = '>'
|
||||
let g:ale_sign_column_always = 1
|
||||
let g:ale_open_list = 0
|
||||
|
||||
" let g:ale_linters = {'scss': ['stylelint'], 'javascript': ['eslint'], 'php':['php'], 'html':['htmlhint'], 'python': [], 'vue': []}
|
||||
let g:ale_linters = {'scss': ['stylelint'], 'javascript': [], 'php':['php'], 'html':['htmlhint'], 'python': [], 'vue': []}
|
||||
|
@ -306,8 +307,8 @@ inoremap jkul <c-o>:call ListUltisnips()<cr>
|
|||
let g:UltiSnipsSnippetsDir='~/.vim/UltiSnips'
|
||||
" Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe.
|
||||
let g:UltiSnipsExpandTrigger='<c-j>'
|
||||
let g:UltiSnipsJumpForwardTrigger='<c-f>'
|
||||
let g:UltiSnipsJumpBackwardTrigger='<c-d>'
|
||||
let g:UltiSnipsJumpForwardTrigger='<tab>'
|
||||
let g:UltiSnipsJumpBackwardTrigger='<s-tab>'
|
||||
let g:UltiSnipsEditSplit='horizontal'
|
||||
|
||||
function! ListUltisnips() abort
|
||||
|
@ -540,15 +541,25 @@ function! GetStatusFrag(condition, colorname, conditionprefix, text) abort "{{{
|
|||
endfunction"}}}
|
||||
|
||||
function! MyFoldText() "{{{
|
||||
let l:columnend = 80 " column to right align foldtext with
|
||||
if !exists('g:foldtext_column')
|
||||
let g:foldtext_column = 80 " column to right align foldtext with
|
||||
endif
|
||||
|
||||
if !exists('b:foldtext_column')
|
||||
let b:foldtext_column = g:foldtext_column " column to right align foldtext with
|
||||
endif
|
||||
|
||||
if !exists('g:foldtext_maxcolumn')
|
||||
let g:foldtext_maxcolumn = 120
|
||||
endif
|
||||
|
||||
let l:linecount = v:foldend - v:foldstart - 1
|
||||
" don't display foldmarker braces
|
||||
let l:line = substitute(getline(v:foldstart), "\{\{\{", "", "")
|
||||
let l:line = substitute(getline(v:foldstart), '\{\{\{', '', '')
|
||||
" don't display vim comment quotation marks
|
||||
let l:line = substitute(l:line, "\^\"\\s\\?", "", "")
|
||||
let l:line = substitute(l:line, "\^\"\\s\\?", '', '')
|
||||
|
||||
let l:postfix = ' +' . l:linecount . ' ' . substitute(v:folddashes, "-", "•", "g")
|
||||
let l:postfix = ' +' . l:linecount . ' ' . substitute(v:folddashes, '-', '•', 'g')
|
||||
while strchars(l:postfix) < 11
|
||||
let l:postfix = ' ' . l:postfix
|
||||
endwhile
|
||||
|
@ -556,28 +567,60 @@ function! MyFoldText() "{{{
|
|||
let l:len_line = len(l:line)
|
||||
let l:len_postfix = strchars(l:postfix)
|
||||
|
||||
if l:len_line + l:len_postfix <= l:columnend
|
||||
let l:padding = ' '[l:len_line + l:len_postfix + 0:l:columnend - 1]
|
||||
if l:len_line + l:len_postfix <= b:foldtext_column
|
||||
let l:padding = ' '[l:len_line + l:len_postfix + 0:b:foldtext_column - 1]
|
||||
let l:foldtext = l:line . l:padding . l:postfix
|
||||
else
|
||||
let l:sniptext = '⋯'
|
||||
let l:foldtext = l:line[:l:columnend - 1 - strchars(l:sniptext) - l:len_postfix] . l:sniptext . l:postfix
|
||||
let l:foldtext = l:line[:b:foldtext_column - 1 - strchars(l:sniptext) - l:len_postfix] . l:sniptext . l:postfix
|
||||
endif
|
||||
|
||||
return l:foldtext
|
||||
endfunction"}}}
|
||||
|
||||
" get name of syntax item
|
||||
function! IndentFoldTextColumn(amount) abort "{{{
|
||||
if !exists('g:foldtext_column')
|
||||
" column to right align foldtext with
|
||||
let g:foldtext_column = 80
|
||||
endif
|
||||
|
||||
if !exists('b:foldtext_column')
|
||||
" column to right align foldtext with
|
||||
let b:foldtext_column = g:foldtext_column
|
||||
endif
|
||||
|
||||
if a:amount == 0
|
||||
let b:foldtext_column = g:foldtext_column
|
||||
return
|
||||
endif
|
||||
|
||||
let l:newcolumn = b:foldtext_column + a:amount
|
||||
if l:newcolumn < 20
|
||||
let l:newcolumn = 20
|
||||
elseif l:newcolumn > g:foldtext_maxcolumn
|
||||
let l:newcolumn = g:foldtext_maxcolumn
|
||||
endif
|
||||
|
||||
let b:foldtext_column = l:newcolumn
|
||||
|
||||
endfunction
|
||||
|
||||
nnoremap <space>z, :<C-U>call IndentFoldTextColumn(-5 * (v:count == 0 ? 1 : v:count))<CR>
|
||||
nnoremap <space>z. :<C-U>call IndentFoldTextColumn(5 * (v:count == 0 ? 1 : v:count))<CR>
|
||||
nnoremap <space>z= :call IndentFoldTextColumn(0)<CR>
|
||||
"}}}
|
||||
|
||||
function! SyntaxItem() abort "{{{
|
||||
" get name of syntax item
|
||||
|
||||
return synIDattr(synID(line('.'),col('.'),1),'name') . ' -> ' . synIDattr(synIDtrans(synID(line('.'),col('.'),1)), 'name' )
|
||||
endfunction
|
||||
nnoremap <space>pp :echom SyntaxItem()<CR>
|
||||
"}}}
|
||||
|
||||
function! s:Get_env() abort "{{{
|
||||
" devdocs DD
|
||||
" https://gist.github.com/romainl/8d3b73428b4366f75a19be2dad2f0987#file-devdocs-vim
|
||||
function! s:Get_env() abort "{{{
|
||||
if has('win64') || has('win32') || has('win16')
|
||||
return 'WINDOWS'
|
||||
else
|
||||
|
@ -595,8 +638,8 @@ command! -nargs=* DD silent! call system(len(split(<q-args>, ' ')) == 0 ?
|
|||
\ s:stub . &ft . ' ' . <q-args> . "'" : s:stub . <q-args> . "'")
|
||||
"}}}
|
||||
|
||||
" use ranger as file manager
|
||||
if !exists('*RangerExplorer') "{{{
|
||||
" use ranger as file manager
|
||||
function RangerExplorer() abort
|
||||
exec 'silent !ranger --choosefile=/tmp/vim_ranger_current_file ' . expand('%:p:h')
|
||||
if filereadable('/tmp/vim_ranger_current_file')
|
||||
|
@ -605,13 +648,13 @@ if !exists('*RangerExplorer') "{{{
|
|||
endif
|
||||
redraw!
|
||||
endfun
|
||||
map <space>ra :call RangerExplorer()<CR>
|
||||
map <space>ra :call RangerExplorer()<CR>
|
||||
endif
|
||||
"}}}
|
||||
|
||||
function! SetColorColumn() abort"{{{
|
||||
if &buftype == ''
|
||||
setlocal colorcolumn=80
|
||||
setlocal colorcolumn=80,120
|
||||
endif
|
||||
endfunction
|
||||
"}}}
|
||||
|
@ -633,9 +676,9 @@ function! GetLinterStatus(key) abort "{{{
|
|||
endfunction
|
||||
"}}}
|
||||
|
||||
function! s:RunShellCommand(cmdline) abort"{{{
|
||||
" Shell command
|
||||
" http://vim.wikia.com/wiki/VimTip1599
|
||||
function! s:RunShellCommand(cmdline) abort"{{{
|
||||
|
||||
let l:expanded_cmdline = a:cmdline
|
||||
for l:part in split(a:cmdline, ' ')
|
||||
|
@ -722,29 +765,29 @@ function! GetDiagnosticCountsFromSigns(buffer) abort "{{{
|
|||
endfunction
|
||||
"}}}
|
||||
|
||||
function! SaveAndExecute(ex_command) abort "{{{
|
||||
" https://stackoverflow.com/a/40195855
|
||||
" ex_command: command to run to execute file
|
||||
function! SaveAndExecute(ex_command) abort "{{{
|
||||
" SOURCE [reusable window]: https://github.com/fatih/vim-go/blob/master/autoload/go/ui.vim
|
||||
|
||||
" save and reload current file
|
||||
silent execute "update | edit"
|
||||
silent execute 'update | edit'
|
||||
|
||||
" get file path of current file
|
||||
let s:current_buffer_file_path = expand("%")
|
||||
let s:current_buffer_file_path = expand('%')
|
||||
|
||||
let s:output_buffer_name = "Output"
|
||||
let s:output_buffer_filetype = "output"
|
||||
let s:output_buffer_name = 'Output'
|
||||
let s:output_buffer_filetype = 'output'
|
||||
|
||||
" reuse existing buffer window if it exists otherwise create a new one
|
||||
if !exists("s:buf_nr") || !bufexists(s:buf_nr) || bufwinnr(s:buf_nr) == -1
|
||||
if !exists('c:buf_nr') || !bufexists(s:buf_nr) || bufwinnr(s:buf_nr) == -1
|
||||
silent execute 'top new ' . s:output_buffer_name
|
||||
let s:buf_nr = bufnr('%')
|
||||
elseif bufwinnr(s:buf_nr) != bufwinnr('%')
|
||||
silent execute bufwinnr(s:buf_nr) . 'wincmd w'
|
||||
endif
|
||||
|
||||
silent execute "setlocal filetype=" . s:output_buffer_filetype
|
||||
silent execute 'setlocal filetype=' . s:output_buffer_filetype
|
||||
setlocal bufhidden=delete
|
||||
setlocal buftype=nofile
|
||||
setlocal noswapfile
|
||||
|
@ -860,7 +903,7 @@ set wrapmargin=0
|
|||
|
||||
set foldcolumn=1
|
||||
set signcolumn=yes
|
||||
set colorcolumn=80
|
||||
set colorcolumn=80,120
|
||||
|
||||
set iskeyword+=-
|
||||
set scrolloff=10
|
||||
|
@ -869,7 +912,7 @@ set incsearch
|
|||
|
||||
set laststatus=2
|
||||
set shortmess=aoOT
|
||||
set cmdheight=2
|
||||
set cmdheight=3
|
||||
|
||||
set foldmethod=manual
|
||||
|
||||
|
@ -939,7 +982,7 @@ nnoremap <space>ee :e .<CR>
|
|||
nnoremap <space>eq :Rex<CR>
|
||||
"}}}
|
||||
|
||||
" better window/tab/buffer navigation/management {{{
|
||||
" better window/tab/buffer navigation/management {{{
|
||||
nnoremap <Esc>j :resize -5<CR>
|
||||
nnoremap <Esc>k :resize +5<CR>
|
||||
nnoremap <Esc>l :vertical resize +5<CR>
|
||||
|
@ -1005,6 +1048,25 @@ iabbrev waht what
|
|||
iabbrev tehn then
|
||||
iabbrev functin function
|
||||
iabbrev positin position
|
||||
|
||||
" css
|
||||
iabbrev w100; width: 100%;
|
||||
iabbrev h100; height: 100%;
|
||||
iabbrev pabs; position: absolute;
|
||||
iabbrev pfix; position: fixed;
|
||||
iabbrev prel; position: relative;
|
||||
iabbrev top0; top: 0;
|
||||
iabbrev bot0; bottom: 0;
|
||||
iabbrev lef0; left: 0;
|
||||
iabbrev rig0; right: 0;
|
||||
iabbrev top100; top: 100%;
|
||||
iabbrev bot100; bottom: 100%;
|
||||
iabbrev lef100; left: 100%;
|
||||
iabbrev rig100; right: 100%;
|
||||
|
||||
iabbrev ct'' content-type: '';
|
||||
iabbrev bgc: background-color: ;<left>
|
||||
|
||||
"}}}
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
|
Loading…
Reference in New Issue