@username
を付けます 1 | let $VIMHOME = expand('<sfile>:p:h')
2 | let s:is_windows = has('win32') || has('win64')
3 |
4 | " Prelude {{{
5 | if has('vim_starting')
6 | " Sets the character encoding inside Vim.
7 | set encoding=utf-8
8 | scriptencoding utf-8
9 |
10 | " Use as many color as possible
1 | function! s:to_view() abort
2 | setl buftype=help
3 | setl nomodifiable readonly
4 | setl nolist
5 | setl nospell
6 | setl colorcolumn=
7 | setl conceallevel=2
8 | setl concealcursor=nv
9 | endfunction
@username
を付けます 64 | if has('nvim')
65 | let s:mkdir = function('mkdir')
66 | else
67 | function! s:mkdir(...) abort
68 | if isdirectory(a:1)
69 | return
70 | endif
71 | return call('mkdir', a:000)
72 | endfunction
73 | endif
353 | function! s:cwindow() abort
354 | let winid = win_getid()
355 | cwindow
356 | if win_getid() != winid
357 | call win_gotoid(winid)
358 | endif
359 | endfunction
360 |
361 | function! s:lwindow() abort
362 | let winid = win_getid()
363 | lwindow
364 | if win_getid() != winid
365 | call win_gotoid(winid)
366 | endif
367 | endfunction
368 |
369 | autocmd MyAutoCmd QuickFixCmdPost [^l]* nested call s:cwindow()
370 | autocmd MyAutoCmd QuickFixCmdPost l* nested call s:lwindow()
423 | function! s:auto_mkdir(dir, force) abort
424 | if empty(a:dir) || a:dir =~# '^\w\+://' || isdirectory(a:dir) || a:dir =~# '^suda:'
425 | return
426 | endif
427 | if !a:force
428 | echohl Question
429 | call inputsave()
430 | try
431 | let result = input(
432 | \ printf('"%s" does not exist. Create? [y/N]', a:dir),
433 | \ '',
434 | \)
435 | if empty(result)
436 | echohl WarningMsg
437 | echo 'Canceled'
438 | return
439 | endif
440 | finally
441 | call inputrestore()
442 | echohl None
443 | endtry
444 | endif
445 | call mkdir(a:dir, 'p')
446 | endfunction
447 | autocmd MyAutoCmd BufWritePre *
448 | \ call s:auto_mkdir(expand('<afile>:p:h'), v:cmdbang)
310 | set formatoptions&
311 | \ formatoptions+=r
312 | \ formatoptions+=o
313 | \ formatoptions+=n
314 | \ formatoptions+=m
315 | \ formatoptions+=B
316 | \ formatoptions+=j