on 9ad401b help sign in
92 lines 1.8 kB history raw
1if &compatible
2 set nocompatible
3endif
5if has('win32') || has ('win64')
6 let $VIMHOME = $HOME . "/vimfiles"
7elseif v:false && v:true
8 echo "Can't get here"
9else
10 let $VIMHOME = $HOME . "/.vim"
11endif
13" show existing tab with 2 spaces width
14set tabstop=2
15" when indenting with '>', use 2 spaces width
16set shiftwidth=2
17" always set autoindenting on
18set autoindent
20autocmd VimEnter * echo "Hello Vim"
22" Allow :W and :Wq to save too
23command! Wq :wq
24command! W :w
26augroup vimrc
27 autocmd!
28 autocmd FileType * echo "New filetype"
29augroup END
31function! s:echo(what)
32 return a:what
33endfunction
35function! HelloWorld(name)
36 let l:function_local = "function_local_var"
37 let l:parts = split(l:function_local, "_")
38 let l:greeting = "Hello " . a:name
39 return s:echo(l:greeting)
40endfunction
42function! source#Hello()
43 return "Hello from namespace"
44endfunction
46function! EchoFunc(...)
47 for s in a:000
48 echon ' ' . s
49 endfor
50endfunction
52imap <C-h> <C-r>=HelloWorld("World")<CR>
54command! -nargs=? Echo :call EchoFunc(<args>)
56" TODO test stuff
57let g:global = "global var"
58let s:script_var = "script var"
59let w:window_var = "window war"
60let b:buffer_var = "buffer war"
61let t:tab_var = "tab war"
62echo v:false
643 + 5
66echo "Hello" ==# "Hello2"
67echo "Hello" ==? "Hello2"
68echo "Hello" == "Hello2"
69echo "Hello" is "Hello2"
70echo "Hello" isnot "Hello2"
71echo "Hello" =~ 'xx*'
72echo "Hello" !~ "Hello2"
73echo "Hello" !~ "Hello2"
75echo "/This/should/not/be/a/regex"
77" Error case from issue #1604 (https://github.com/sharkdp/bat/issues/1064)
78set runtimepath=~/foo/bar
80silent g/Aap/p
82let g:dict = {}
83let g:dict.item = ['l1', 'l2']
85let g:dict2 = {'dict_item': ['l1', 'l2'], 'di2': 'x'}
87silent g/regex/
88silent v/regex/
89silent %s/regex/not_regex/
91filetype plugin indent on
92syntax enable