-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinit.vim
More file actions
48 lines (44 loc) · 1.61 KB
/
Copy pathinit.vim
File metadata and controls
48 lines (44 loc) · 1.61 KB
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
let g:python3_host_prog = "/Users/wiyr/.pyenv/versions/3.7.5/bin/python3"
lua require("core")
" 光标记忆
augroup JumpCursorOnEdit
au!
autocmd BufReadPost *
\ if expand("<afile>:p:h") !=? $TEMP |
\ if line("'\"") > 1 && line("'\"") <= line("$") |
\ let JumpCursorOnEdit_foo = line("'\"") |
\ let b:doopenfold = 1 |
\ if (foldlevel(JumpCursorOnEdit_foo) > foldlevel(JumpCursorOnEdit_foo - 1)) |
\ let JumpCursorOnEdit_foo = JumpCursorOnEdit_foo - 1 |
\ let b:doopenfold = 2 |
\ endif |
\ exe JumpCursorOnEdit_foo |
\ endif |
\ endif
" Need to postpone using "zv" until after reading the modelines.
autocmd BufWinEnter *
\ if exists("b:doopenfold") |
\ exe "normal zv" |
\ if(b:doopenfold > 1) |
\ exe "+".1 |
\ endif |
\ unlet b:doopenfold |
\ endif
augroup END
augroup dirvish_config
autocmd!
" Map `t` to open in new tab.
autocmd FileType dirvish
\ nnoremap <silent><buffer> 7 :call dirvish#open('tabedit', 0)<CR>
\ |xnoremap <silent><buffer> t :call dirvish#open('tabedit', 0)<CR>
autocmd FileType dirvish
\ nnoremap <silent><buffer> 8 :call dirvish#open('split', 0)<CR>
autocmd FileType dirvish
\ nnoremap <silent><buffer> 9 :call dirvish#open('vsplit', 0)<CR>
" Map `gr` to reload.
autocmd FileType dirvish nnoremap <silent><buffer>
\ gr :<C-U>Dirvish %<CR>
" Map `gh` to hide dot-prefixed files. Press `R` to "toggle" (reload).
autocmd FileType dirvish nnoremap <silent><buffer>
\ gh :silent keeppatterns g@\v/\.[^\/]+/?$@d _<cr>:setl cole=3<cr>
augroup END