update abbreviations

This commit is contained in:
ManjaroOne666 2018-10-04 19:33:32 +01:00
parent 5f2a64b199
commit 2eb2e7f8aa
1 changed files with 97 additions and 35 deletions

112
vimrc
View File

@ -164,8 +164,8 @@ let g:inline_edit_patterns = [{
\ }] \ }]
let g:inline_edit_autowrite = 1 let g:inline_edit_autowrite = 1
let g:inline_edit_proxy_type = "tempfile" let g:inline_edit_proxy_type = 'tempfile'
let g:inline_edit_new_buffer_command ="tabedit" let g:inline_edit_new_buffer_command ='tabedit'
let g:inline_edit_modify_statusline = 0 let g:inline_edit_modify_statusline = 0
nnoremap <space>ie :InlineEdit<cr> nnoremap <space>ie :InlineEdit<cr>
@ -224,6 +224,7 @@ nnoremap <space>pe :lprev<cr>
let g:ale_sign_error = '>>' let g:ale_sign_error = '>>'
let g:ale_sign_warning = '>' let g:ale_sign_warning = '>'
let g:ale_sign_column_always = 1 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': ['eslint'], 'php':['php'], 'html':['htmlhint'], 'python': [], 'vue': []}
let g:ale_linters = {'scss': ['stylelint'], 'javascript': [], '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' let g:UltiSnipsSnippetsDir='~/.vim/UltiSnips'
" Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe. " Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe.
let g:UltiSnipsExpandTrigger='<c-j>' let g:UltiSnipsExpandTrigger='<c-j>'
let g:UltiSnipsJumpForwardTrigger='<c-f>' let g:UltiSnipsJumpForwardTrigger='<tab>'
let g:UltiSnipsJumpBackwardTrigger='<c-d>' let g:UltiSnipsJumpBackwardTrigger='<s-tab>'
let g:UltiSnipsEditSplit='horizontal' let g:UltiSnipsEditSplit='horizontal'
function! ListUltisnips() abort function! ListUltisnips() abort
@ -540,15 +541,25 @@ function! GetStatusFrag(condition, colorname, conditionprefix, text) abort "{{{
endfunction"}}} endfunction"}}}
function! MyFoldText() "{{{ 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 let l:linecount = v:foldend - v:foldstart - 1
" don't display foldmarker braces " 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 " 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 while strchars(l:postfix) < 11
let l:postfix = ' ' . l:postfix let l:postfix = ' ' . l:postfix
endwhile endwhile
@ -556,28 +567,60 @@ function! MyFoldText() "{{{
let l:len_line = len(l:line) let l:len_line = len(l:line)
let l:len_postfix = strchars(l:postfix) let l:len_postfix = strchars(l:postfix)
if l:len_line + l:len_postfix <= l:columnend if l:len_line + l:len_postfix <= b:foldtext_column
let l:padding = ' '[l:len_line + l:len_postfix + 0:l:columnend - 1] let l:padding = ' '[l:len_line + l:len_postfix + 0:b:foldtext_column - 1]
let l:foldtext = l:line . l:padding . l:postfix let l:foldtext = l:line . l:padding . l:postfix
else else
let l:sniptext = '⋯' 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 endif
return l:foldtext return l:foldtext
endfunction"}}} 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 "{{{ function! SyntaxItem() abort "{{{
" get name of syntax item
return synIDattr(synID(line('.'),col('.'),1),'name') . ' -> ' . synIDattr(synIDtrans(synID(line('.'),col('.'),1)), 'name' ) return synIDattr(synID(line('.'),col('.'),1),'name') . ' -> ' . synIDattr(synIDtrans(synID(line('.'),col('.'),1)), 'name' )
endfunction endfunction
nnoremap <space>pp :echom SyntaxItem()<CR> nnoremap <space>pp :echom SyntaxItem()<CR>
"}}} "}}}
function! s:Get_env() abort "{{{
" devdocs DD " devdocs DD
" https://gist.github.com/romainl/8d3b73428b4366f75a19be2dad2f0987#file-devdocs-vim " https://gist.github.com/romainl/8d3b73428b4366f75a19be2dad2f0987#file-devdocs-vim
function! s:Get_env() abort "{{{
if has('win64') || has('win32') || has('win16') if has('win64') || has('win32') || has('win16')
return 'WINDOWS' return 'WINDOWS'
else 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> . "'") \ s:stub . &ft . ' ' . <q-args> . "'" : s:stub . <q-args> . "'")
"}}} "}}}
" use ranger as file manager
if !exists('*RangerExplorer') "{{{ if !exists('*RangerExplorer') "{{{
" use ranger as file manager
function RangerExplorer() abort function RangerExplorer() abort
exec 'silent !ranger --choosefile=/tmp/vim_ranger_current_file ' . expand('%:p:h') exec 'silent !ranger --choosefile=/tmp/vim_ranger_current_file ' . expand('%:p:h')
if filereadable('/tmp/vim_ranger_current_file') if filereadable('/tmp/vim_ranger_current_file')
@ -611,7 +654,7 @@ endif
function! SetColorColumn() abort"{{{ function! SetColorColumn() abort"{{{
if &buftype == '' if &buftype == ''
setlocal colorcolumn=80 setlocal colorcolumn=80,120
endif endif
endfunction endfunction
"}}} "}}}
@ -633,9 +676,9 @@ function! GetLinterStatus(key) abort "{{{
endfunction endfunction
"}}} "}}}
function! s:RunShellCommand(cmdline) abort"{{{
" Shell command " Shell command
" http://vim.wikia.com/wiki/VimTip1599 " http://vim.wikia.com/wiki/VimTip1599
function! s:RunShellCommand(cmdline) abort"{{{
let l:expanded_cmdline = a:cmdline let l:expanded_cmdline = a:cmdline
for l:part in split(a:cmdline, ' ') for l:part in split(a:cmdline, ' ')
@ -722,29 +765,29 @@ function! GetDiagnosticCountsFromSigns(buffer) abort "{{{
endfunction endfunction
"}}} "}}}
function! SaveAndExecute(ex_command) abort "{{{
" https://stackoverflow.com/a/40195855 " https://stackoverflow.com/a/40195855
" ex_command: command to run to execute file " 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 " SOURCE [reusable window]: https://github.com/fatih/vim-go/blob/master/autoload/go/ui.vim
" save and reload current file " save and reload current file
silent execute "update | edit" silent execute 'update | edit'
" get file path of current file " 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_name = 'Output'
let s:output_buffer_filetype = "output" let s:output_buffer_filetype = 'output'
" reuse existing buffer window if it exists otherwise create a new one " 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 silent execute 'top new ' . s:output_buffer_name
let s:buf_nr = bufnr('%') let s:buf_nr = bufnr('%')
elseif bufwinnr(s:buf_nr) != bufwinnr('%') elseif bufwinnr(s:buf_nr) != bufwinnr('%')
silent execute bufwinnr(s:buf_nr) . 'wincmd w' silent execute bufwinnr(s:buf_nr) . 'wincmd w'
endif endif
silent execute "setlocal filetype=" . s:output_buffer_filetype silent execute 'setlocal filetype=' . s:output_buffer_filetype
setlocal bufhidden=delete setlocal bufhidden=delete
setlocal buftype=nofile setlocal buftype=nofile
setlocal noswapfile setlocal noswapfile
@ -860,7 +903,7 @@ set wrapmargin=0
set foldcolumn=1 set foldcolumn=1
set signcolumn=yes set signcolumn=yes
set colorcolumn=80 set colorcolumn=80,120
set iskeyword+=- set iskeyword+=-
set scrolloff=10 set scrolloff=10
@ -869,7 +912,7 @@ set incsearch
set laststatus=2 set laststatus=2
set shortmess=aoOT set shortmess=aoOT
set cmdheight=2 set cmdheight=3
set foldmethod=manual set foldmethod=manual
@ -1005,6 +1048,25 @@ iabbrev waht what
iabbrev tehn then iabbrev tehn then
iabbrev functin function iabbrev functin function
iabbrev positin position 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>
"}}} "}}}
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""