-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquickui.vim
More file actions
70 lines (62 loc) · 2.5 KB
/
Copy pathquickui.vim
File metadata and controls
70 lines (62 loc) · 2.5 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
" clear all the menus
call quickui#menu#reset()
" install a 'File' menu, use [text, command] to represent an item.
call quickui#menu#install('&File', [
\ [ "&New File\tCtrl+n", 'echo 0' ],
\ [ "&Open File\t(F3)", 'echo 1' ],
\ [ "&Close", ':q<CR>' ],
\ [ "&Toggle Nvim-Tree", ':NvimTreeToggle<CR>' ],
\ [ "--", '' ],
\ [ "&Save\tCtrl+s", ':w<CR>'],
\ [ "Save &As", ':saveas ' ],
\ [ "Save All", ':wa<CR>' ],
\ [ "--", '' ],
\ [ "E&xit\tAlt+x", 'echo 6' ],
\ ])
" items containing tips, tips will display in the cmdline
call quickui#menu#install('&Edit', [
\ [ '&Copy', 'echo 1', 'help 1' ],
\ [ '&Paste', 'echo 2', 'help 2' ],
\ [ '&Find', 'echo 3', 'help 3' ],
\ ])
" script inside %{...} will be evaluated and expanded in the string
call quickui#menu#install("&Option", [
\ ['Set &Spell %{&spell? "Off":"On"}', 'set spell!'],
\ ['Set &Cursor Line %{&cursorline? "Off":"On"}', 'set cursorline!'],
\ ['Set &Paste %{&paste? "Off":"On"}', 'set paste!'],
\ ['Set &hlsearch %{&hlsearch? "Off":"On"}', 'set hlsearch!'],
\ ])
" register HELP menu with weight 1000
call quickui#menu#install('&Help', [
\ ["&Cheatsheet", 'help index', ''],
\ ['T&ips', 'help tips', ''],
\ ['--',''],
\ ["&Tutorial", 'help tutor', ''],
\ ['&Quick Reference', 'help quickref', ''],
\ ['&Summary', 'help summary', ''],
\ ], 10000)
" register PROJECT menu for shortcuts to build projects
" TODO: work in progress
call quickui#menu#install('&PROJECT', [
\ ['&Build project', ''],
\ ['&Run project', ''],
\ ])
" register CONFIG menu for modifying neovim configuration files
" The paths will be different according to each operating system
if has("win32") || has("win16")
call quickui#menu#install('&CONFIG', [
\ ['&init.vim', 'vnew $HOME\AppData\Local\nvim\init.vim'],
\ ['&keybindings.vim', 'vnew $HOME\AppData\Local\nvim\keybindings.vim'],
\ ['Go to Configuration &Directory', 'vnew $HOME\AppData\Local\nvim'],
\ ])
else
call quickui#menu#install('&CONFIG', [
\ ['&init.vim', 'vnew ~/.config/nvim/init.vim'],
\ ['&keybindings.vim', 'vnew ~/.config/nvim/keybindings.vim'],
\ ['Go to Configuration &Directory', 'vnew ~/.config/nvim'],
\ ])
endif
" enable to display tips in the cmdline
let g:quickui_show_tip = 1
" hit space twice to open menu
noremap <space><space> :call quickui#menu#open()<cr>