annotate runtime/macros/less.vim @ 32996:dd8da8f1c2bc v9.0.1790

patch 9.0.1790: Redundant LSP Content-Type header Commit: https://github.com/vim/vim/commit/8fbd9449e71f2ad93e594be575209a7424eb093e Author: Magnus Gro? <magnus@mggross.com> Date: Sun Aug 27 00:49:51 2023 +0200 patch 9.0.1790: Redundant LSP Content-Type header Problem: The Content-Type header is an optional header that some LSP servers struggle with and may crash when encountering it. Solution: Drop the Content-Type header from all messages, because we use the default value anyway. Because pretty much all popular LSP clients (e.g. coc.nvim, VSCode) do not send the Content-Type header, the LSP server ecosystem has developed such that some LSP servers may even crash when encountering it. To improve compatibility with these misbehaving LSP servers, we drop this header as well. Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Magnus Gro? <magnus@mggross.com>
author Christian Brabandt <cb@256bit.org>
date Sun, 27 Aug 2023 11:15:03 +0200
parents 4027cefc2aab
children 9ddc74d06433
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim script to work like "less"
32770
4027cefc2aab Farewell to Bram and dedicate upcoming Vim 9.1 to him (#12749)
Christian Brabandt <cb@256bit.org>
parents: 23305
diff changeset
2 " Maintainer: The Vim Project <https://github.com/vim/vim>
4027cefc2aab Farewell to Bram and dedicate upcoming Vim 9.1 to him (#12749)
Christian Brabandt <cb@256bit.org>
parents: 23305
diff changeset
3 " Last Change: 2023 Aug 10
4027cefc2aab Farewell to Bram and dedicate upcoming Vim 9.1 to him (#12749)
Christian Brabandt <cb@256bit.org>
parents: 23305
diff changeset
4 " Former Maintainer: Bram Moolenaar <Bram@vim.org>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " Avoid loading this file twice, allow the user to define his own script.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 if exists("loaded_less")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 let loaded_less = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 " If not reading from stdin, skip files that can't be read.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 " Exit if there is no file at all.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 if argc() > 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 let s:i = 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 while 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 if filereadable(argv(s:i))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 if s:i != 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 sleep 3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 break
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 if isdirectory(argv(s:i))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 echomsg "Skipping directory " . argv(s:i)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 elseif getftime(argv(s:i)) < 0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 echomsg "Skipping non-existing file " . argv(s:i)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 echomsg "Skipping unreadable file " . argv(s:i)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 echo "\n"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 let s:i = s:i + 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 if s:i == argc()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 quit
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 next
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 endwhile
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
23305
fab58304f77d Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 20552
diff changeset
39 " we don't want 'compatible' here
fab58304f77d Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 20552
diff changeset
40 if &cp
fab58304f77d Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 20552
diff changeset
41 set nocp
fab58304f77d Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 20552
diff changeset
42 endif
fab58304f77d Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 20552
diff changeset
43
fab58304f77d Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 20552
diff changeset
44 " enable syntax highlighting if not done already
fab58304f77d Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 20552
diff changeset
45 if !get(g:, 'syntax_on', 0)
fab58304f77d Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 20552
diff changeset
46 syntax enable
fab58304f77d Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 20552
diff changeset
47 endif
fab58304f77d Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 20552
diff changeset
48
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 set so=0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 set hlsearch
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 set incsearch
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 nohlsearch
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 " Don't remember file names and positions
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 set viminfo=
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 set nows
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 " Inhibit screen updates while searching
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 let s:lz = &lz
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 set lz
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59
7245
8896150aba23 commit https://github.com/vim/vim/commit/e392eb41f8dfc01bd13634e534ac6b4d505326f4
Christian Brabandt <cb@256bit.org>
parents: 5908
diff changeset
60 " Allow the user to define a function, which can set options specifically for
8896150aba23 commit https://github.com/vim/vim/commit/e392eb41f8dfc01bd13634e534ac6b4d505326f4
Christian Brabandt <cb@256bit.org>
parents: 5908
diff changeset
61 " this script.
8896150aba23 commit https://github.com/vim/vim/commit/e392eb41f8dfc01bd13634e534ac6b4d505326f4
Christian Brabandt <cb@256bit.org>
parents: 5908
diff changeset
62 if exists('*LessInitFunc')
8896150aba23 commit https://github.com/vim/vim/commit/e392eb41f8dfc01bd13634e534ac6b4d505326f4
Christian Brabandt <cb@256bit.org>
parents: 5908
diff changeset
63 call LessInitFunc()
8896150aba23 commit https://github.com/vim/vim/commit/e392eb41f8dfc01bd13634e534ac6b4d505326f4
Christian Brabandt <cb@256bit.org>
parents: 5908
diff changeset
64 endif
8896150aba23 commit https://github.com/vim/vim/commit/e392eb41f8dfc01bd13634e534ac6b4d505326f4
Christian Brabandt <cb@256bit.org>
parents: 5908
diff changeset
65
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 " Used after each command: put cursor at end and display position
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 if &wrap
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 noremap <SID>L L0:redraw<CR>:file<CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 au VimEnter * normal! L0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 noremap <SID>L Lg0:redraw<CR>:file<CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 au VimEnter * normal! Lg0
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 " When reading from stdin don't consider the file modified.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 au VimEnter * set nomod
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77
20552
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 11347
diff changeset
78 " Can't modify the text or write the file.
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 11347
diff changeset
79 set nomodifiable readonly
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 " Give help
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 noremap h :call <SID>Help()<CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 map H h
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 fun! s:Help()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 echo "<Space> One page forward b One page backward"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 echo "d Half a page forward u Half a page backward"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 echo "<Enter> One line forward k One line backward"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 echo "G End of file g Start of file"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 echo "N% percentage in file"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 echo "\n"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 echo "/pattern Search for pattern ?pattern Search backward for pattern"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 echo "n next pattern match N Previous pattern match"
11347
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 7245
diff changeset
93 if &foldmethod != "manual"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 7245
diff changeset
94 echo "\n"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 7245
diff changeset
95 echo "zR open all folds zm increase fold level"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 7245
diff changeset
96 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 echo "\n"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 echo ":n<Enter> Next file :p<Enter> Previous file"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 echo "\n"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 echo "q Quit v Edit file"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 let i = input("Hit Enter to continue")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 endfun
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 " Scroll one page forward
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 noremap <script> <Space> :call <SID>NextPage()<CR><SID>L
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 map <C-V> <Space>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 map f <Space>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 map <C-F> <Space>
5908
32de51778c27 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3526
diff changeset
109 map <PageDown> <Space>
32de51778c27 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3526
diff changeset
110 map <kPageDown> <Space>
32de51778c27 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3526
diff changeset
111 map <S-Down> <Space>
11347
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 7245
diff changeset
112 " If 'foldmethod' was changed keep the "z" commands, e.g. "zR" to open all
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 7245
diff changeset
113 " folds.
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 7245
diff changeset
114 if &foldmethod == "manual"
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 7245
diff changeset
115 map z <Space>
4aae8146c21f Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 7245
diff changeset
116 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 map <Esc><Space> <Space>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 fun! s:NextPage()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 if line(".") == line("$")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 if argidx() + 1 >= argc()
3513
1b584a6f446c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1125
diff changeset
121 " Don't quit at the end of the last file
1b584a6f446c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1125
diff changeset
122 return
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 next
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 exe "normal! \<C-F>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 endfun
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 " Re-read file and page forward "tail -f"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 map F :e<CR>G<SID>L:sleep 1<CR>F
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 " Scroll half a page forward
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 noremap <script> d <C-D><SID>L
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 map <C-D> d
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 " Scroll one line forward
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 noremap <script> <CR> <C-E><SID>L
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 map <C-N> <CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 map e <CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 map <C-E> <CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 map j <CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144 map <C-J> <CR>
5908
32de51778c27 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3526
diff changeset
145 map <Down> <CR>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 " Scroll one page backward
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 noremap <script> b <C-B><SID>L
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 map <C-B> b
5908
32de51778c27 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3526
diff changeset
150 map <PageUp> b
32de51778c27 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3526
diff changeset
151 map <kPageUp> b
32de51778c27 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3526
diff changeset
152 map <S-Up> b
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 map w b
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154 map <Esc>v b
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 " Scroll half a page backward
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 noremap <script> u <C-U><SID>L
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 noremap <script> <C-U> <C-U><SID>L
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 " Scroll one line backward
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 noremap <script> k <C-Y><SID>L
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 map y k
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163 map <C-Y> k
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164 map <C-P> k
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165 map <C-K> k
5908
32de51778c27 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3526
diff changeset
166 map <Up> k
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168 " Redraw
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169 noremap <script> r <C-L><SID>L
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170 noremap <script> <C-R> <C-L><SID>L
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171 noremap <script> R <C-L><SID>L
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173 " Start of file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 noremap <script> g gg<SID>L
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175 map < g
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176 map <Esc>< g
5908
32de51778c27 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3526
diff changeset
177 map <Home> g
32de51778c27 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3526
diff changeset
178 map <kHome> g
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180 " End of file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181 noremap <script> G G<SID>L
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182 map > G
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183 map <Esc>> G
5908
32de51778c27 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3526
diff changeset
184 map <End> G
32de51778c27 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3526
diff changeset
185 map <kEnd> G
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187 " Go to percentage
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188 noremap <script> % %<SID>L
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
189 map p %
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191 " Search
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192 noremap <script> / H$:call <SID>Forward()<CR>/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
193 if &wrap
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194 noremap <script> ? H0:call <SID>Backward()<CR>?
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196 noremap <script> ? Hg0:call <SID>Backward()<CR>?
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
199 fun! s:Forward()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200 " Searching forward
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201 noremap <script> n H$nzt<SID>L
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202 if &wrap
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203 noremap <script> N H0Nzt<SID>L
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
205 noremap <script> N Hg0Nzt<SID>L
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206 endif
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 874
diff changeset
207 cnoremap <silent> <script> <CR> <CR>:cunmap <lt>CR><CR>zt<SID>L
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208 endfun
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210 fun! s:Backward()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211 " Searching backward
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212 if &wrap
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213 noremap <script> n H0nzt<SID>L
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
214 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215 noremap <script> n Hg0nzt<SID>L
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217 noremap <script> N H$Nzt<SID>L
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 874
diff changeset
218 cnoremap <silent> <script> <CR> <CR>:cunmap <lt>CR><CR>zt<SID>L
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219 endfun
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
220
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
221 call s:Forward()
5908
32de51778c27 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3526
diff changeset
222 cunmap <CR>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
223
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
224 " Quitting
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
225 noremap q :q<CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
226
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
227 " Switch to editing (switch off less mode)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
228 map v :silent call <SID>End()<CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
229 fun! s:End()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
230 set ma
874
4bac29d27e2f updated for version 7.0
vimboss
parents: 7
diff changeset
231 if exists('s:lz')
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
232 let &lz = s:lz
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
233 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
234 unmap h
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
235 unmap H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
236 unmap <Space>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
237 unmap <C-V>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
238 unmap f
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
239 unmap <C-F>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
240 unmap z
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
241 unmap <Esc><Space>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
242 unmap F
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
243 unmap d
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
244 unmap <C-D>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
245 unmap <CR>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
246 unmap <C-N>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
247 unmap e
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
248 unmap <C-E>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
249 unmap j
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
250 unmap <C-J>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
251 unmap b
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
252 unmap <C-B>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
253 unmap w
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
254 unmap <Esc>v
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
255 unmap u
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
256 unmap <C-U>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
257 unmap k
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
258 unmap y
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
259 unmap <C-Y>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
260 unmap <C-P>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
261 unmap <C-K>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
262 unmap r
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
263 unmap <C-R>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
264 unmap R
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
265 unmap g
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
266 unmap <
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
267 unmap <Esc><
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
268 unmap G
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
269 unmap >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
270 unmap <Esc>>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
271 unmap %
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
272 unmap p
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
273 unmap n
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
274 unmap N
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
275 unmap q
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
276 unmap v
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
277 unmap /
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
278 unmap ?
5908
32de51778c27 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3526
diff changeset
279 unmap <Up>
32de51778c27 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3526
diff changeset
280 unmap <Down>
32de51778c27 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3526
diff changeset
281 unmap <PageDown>
32de51778c27 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3526
diff changeset
282 unmap <kPageDown>
32de51778c27 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3526
diff changeset
283 unmap <PageUp>
32de51778c27 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3526
diff changeset
284 unmap <kPageUp>
32de51778c27 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3526
diff changeset
285 unmap <S-Down>
32de51778c27 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3526
diff changeset
286 unmap <S-Up>
32de51778c27 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3526
diff changeset
287 unmap <Home>
32de51778c27 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3526
diff changeset
288 unmap <kHome>
32de51778c27 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3526
diff changeset
289 unmap <End>
32de51778c27 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3526
diff changeset
290 unmap <kEnd>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
291 endfun
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
292
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
293 " vim: sw=2