44< head >
55 < meta charset ="UTF-8 ">
66< meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
7- < meta name ="description " content ="Buffers and Windows "> < meta property ="og:title " content ="" />
7+ < meta name ="description " content ="Buffers and Windows "> < meta property ="og:title " content ="Buffers and Windows " />
88< meta property ="og:description " content ="" />
99< meta property ="og:type " content ="website " />
1010< meta property ="og:url " content ="http://jacobsimpson.github.io/docs/buffers-and-windows/ " />
1616< link rel ="stylesheet " href ="/book.min.0379377fb17315c9a560efd4d406aea4535c095a461b220fd9e3d2e9c05550e6.css " integrity ="sha256-A3k3f7FzFcmlYO/U1AaupFNcCVpGGyIP2ePS6cBVUOY= ">
1717
1818
19- < script defer src ="/en.search.min.839f2dba0cb3de6ef9ba220f9c62ed2324cd45180025044a6f8fbe7e10efa453 .js " integrity ="sha256-g58tugyz3m75uiIPnGLtIyTNRRgAJQRKb4 ++fhDvpFM = "> </ script >
19+ < script defer src ="/en.search.min.f8bd81b39333232597285f6430d80a88189645cc0ef5fbd4d739512bc3d4aca6 .js " integrity ="sha256-+L2Bs5MzIyWXKF9kMNgKiBiWRcwO9fvU1zlRK8PUrKY = "> </ script >
2020
2121< link rel ="alternate " type ="application/rss+xml " href ="http://jacobsimpson.github.io/docs/buffers-and-windows/index.xml " title ="Scripting Neovim with Lua " />
2222<!--
@@ -127,8 +127,8 @@ <h2 class="book-brand">
127127
128128
129129
130- < a href ="/docs/buffers-and-windows / " class =" active " >
131- Buffers and Windows
130+ < a href ="/docs/job-control / " >
131+ Job Control
132132 </ a >
133133
134134
@@ -139,12 +139,6 @@ <h2 class="book-brand">
139139
140140
141141
142-
143- < ul >
144-
145- </ ul >
146-
147-
148142
149143
150144 </ li >
@@ -159,8 +153,8 @@ <h2 class="book-brand">
159153
160154
161155
162- < a href ="/docs/job-control / " >
163- Job Control
156+ < a href ="/docs/buffers-and-windows / " class =" active " >
157+ Buffers and Windows
164158 </ a >
165159
166160
@@ -171,6 +165,12 @@ <h2 class="book-brand">
171165
172166
173167
168+
169+ < ul >
170+
171+ </ ul >
172+
173+
174174
175175
176176 </ li >
@@ -259,21 +259,18 @@ <h3 id="replacing-a-buffer">Replacing a Buffer</h3>
259259
260260< h3 id ="setting-options-on-a-buffer "> Setting Options on a Buffer</ h3 >
261261
262- < pre > < code class ="language-lua "> vim.api.nvim_buf_set_option(statusBuffer, 'buftype', 'nofile')
263- vim.api.nvim_buf_set_option(statusBuffer, 'filetype', 'lua')
264- </ code > </ pre >
262+ < div class ="highlight "> < pre style ="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4 "> < code class ="language-lua " data-lang ="lua "> vim.api.nvim_buf_set_option(statusBuffer, < span style ="color:#e6db74 "> 'buftype'</ span > , < span style ="color:#e6db74 "> 'nofile'</ span > )
263+ vim.api.nvim_buf_set_option(statusBuffer, < span style ="color:#e6db74 "> 'filetype'</ span > , < span style ="color:#e6db74 "> 'lua'</ span > )</ code > </ pre > </ div >
265264
266265< p > I would think that it would be possible to set the < code > modifiable</ code > attribute in
267266the same way as the attributes above, using < code > nvim_buf_set_option</ code > , but I’ve not
268267been able to figure out the syntax for that. So, I do it this way:</ p >
269268
270- < pre > < code class ="language-lua "> vim.api.nvim_command("setlocal nomodifiable")
271- </ code > </ pre >
269+ < div class ="highlight "> < pre style ="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4 "> < code class ="language-lua " data-lang ="lua "> vim.api.nvim_command(< span style ="color:#e6db74 "> "setlocal nomodifiable"</ span > )</ code > </ pre > </ div >
272270
273271< p > The name of a buffer is not a standard option, and has it’s own function:</ p >
274272
275- < pre > < code class ="language-lua "> vim.api.nvim_buf_set_name(statusBuffer, 'hg status')
276- </ code > </ pre >
273+ < div class ="highlight "> < pre style ="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4 "> < code class ="language-lua " data-lang ="lua "> vim.api.nvim_buf_set_name(statusBuffer, < span style ="color:#e6db74 "> 'hg status'</ span > )</ code > </ pre > </ div >
277274</ article >
278275
279276 < div class ="book-footer justify-between ">
0 commit comments