Skip to content

Commit e35e2f3

Browse files
committed
don't startinsert with funced, closes #12
1 parent 9da005e commit e35e2f3

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

ftdetect/fish.vim

+4-9
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,8 @@ autocmd BufRead *
66
\ setlocal filetype=fish |
77
\ endif
88

9-
" Start Insert inside function edited with `funced`.
10-
autocmd BufRead fish_funced_*_*.fish
11-
\ ?\C^end\>?-1 |
12-
\ if getline('.') ==# '' |
13-
\ execute "normal! i\<C-t>" |
14-
\ endif |
15-
\ startinsert!
9+
" Move cursor to first empty line when using funced.
10+
autocmd BufRead fish_funced_*_*.fish call search('^$')
1611

1712
" Fish histories are YAML documents.
1813
autocmd BufRead,BufNewFile ~/.config/fish/fish_{read_,}history setfiletype yaml
@@ -23,6 +18,6 @@ autocmd BufRead,BufNewFile ~/.config/fish/fishd.* setlocal readonly
2318
" Mimic `funced` when manually creating functions.
2419
autocmd BufNewFile ~/.config/fish/functions/*.fish
2520
\ call append(0, ['function '.expand('%:t:r'),
26-
\repeat(' ', &shiftwidth),
21+
\'',
2722
\'end']) |
28-
\ 4delete | 2 | startinsert!
23+
\ 2

0 commit comments

Comments
 (0)