diff options
| author | srdusr <trevorgray@srdusr.com> | 2023-09-27 20:10:54 +0200 |
|---|---|---|
| committer | srdusr <trevorgray@srdusr.com> | 2023-09-27 20:10:54 +0200 |
| commit | 1e86949e066f2ada7284c44d927c926ba1725142 (patch) | |
| tree | 796058408d403ce574e90ba22fbd0e40e2c6cdb8 /lua | |
| parent | 99d23da2fbb0c586e2aaca84ddaa09bbadf525fc (diff) | |
| download | dotfiles-1e86949e066f2ada7284c44d927c926ba1725142.tar.gz dotfiles-1e86949e066f2ada7284c44d927c926ba1725142.zip | |
Enable mouse scrollback
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/user/opts.lua | 66 |
1 files changed, 42 insertions, 24 deletions
diff --git a/lua/user/opts.lua b/lua/user/opts.lua index c724710..3bf5b37 100644 --- a/lua/user/opts.lua +++ b/lua/user/opts.lua @@ -18,30 +18,30 @@ vim.opt.clipboard:append({ 'unnamedplus' }) -- Install xclip or this will slowdo -- Behaviour vim.opt.backspace = { 'start', 'eol', 'indent' } -- Make backspace work as you would expect. -vim.opt.hidden = true -- Switch between buffers without having to save first. -vim.opt.splitbelow = true -- make split put the new buffer below the current buffer -vim.opt.splitright = true -- make vsplit put the new buffer on the right of the current buffer -vim.opt.scrolloff = 8 -- -vim.opt.sidescrolloff = 8 -- how many lines to scroll when using the scrollbar -vim.opt.autoread = true -- reload files if changed externally -vim.opt.display = 'lastline' -- Show as much as possible of the last line. -vim.opt.inccommand = 'split' -- -vim.opt.ttyfast = true -- Faster redrawing. -vim.opt.lazyredraw = false -- Only redraw when necessary -vim.opt.keywordprg = ':help' -- :help options -vim.opt.ruler = true -- -vim.opt.errorbells = false -- -vim.opt.list = true -- Show non-printable characters. -vim.opt.showmatch = true -- -vim.opt.matchtime = 3 -- -vim.opt.showbreak = '↪ ' -- -vim.opt.linebreak = true -- -vim.opt.exrc = true -- +vim.opt.hidden = true -- Switch between buffers without having to save first. +vim.opt.splitbelow = true -- make split put the new buffer below the current buffer +vim.opt.splitright = true -- make vsplit put the new buffer on the right of the current buffer +vim.opt.scrolloff = 8 -- +vim.opt.sidescrolloff = 8 -- how many lines to scroll when using the scrollbar +vim.opt.autoread = true -- reload files if changed externally +vim.opt.display = 'lastline' -- Show as much as possible of the last line. +vim.opt.inccommand = 'split' -- +vim.opt.ttyfast = true -- Faster redrawing. +vim.opt.lazyredraw = false -- Only redraw when necessary +vim.opt.keywordprg = ':help' -- :help options +vim.opt.ruler = true -- +vim.opt.errorbells = false -- +vim.opt.list = true -- Show non-printable characters. +vim.opt.showmatch = true -- +vim.opt.matchtime = 3 -- +vim.opt.showbreak = '↪ ' -- +vim.opt.linebreak = true -- +vim.opt.exrc = true -- --vim.opt.autochdir = true -- or use this to use <:e> to create a file in current directory -vim.opt.autoread = true -- if a file is changed outside of vim, automatically reload it without asking +vim.opt.autoread = true -- if a file is changed outside of vim, automatically reload it without asking --vim.opt.notimeout = true -- Timeout on keycodes and not mappings -vim.opt.ttimeout = true -- Makes terminal vim work sanely -vim.opt.ttimeoutlen = 10 -- +vim.opt.ttimeout = true -- Makes terminal vim work sanely +vim.opt.ttimeoutlen = 10 -- --vim.opt.timeoutlen = 100 -- time to wait for a mapped sequence to complete (in milliseconds) --vim.cmd([[set diffopt = vertical = true]]) -- diffs are shown side-by-side not above/below @@ -179,8 +179,8 @@ vim.opt.fillchars = { } vim.opt.listchars = { tab = '▸ ', trail = '·' } -- --vim.opt.fillchars:append({ eob = " " }) -- remove the ~ from end of buffer -vim.opt.modeline = true -- -vim.opt.modelines = 3 -- modelines (comments that set vim options on a per-file basis) +vim.opt.modeline = true -- +vim.opt.modelines = 3 -- modelines (comments that set vim options on a per-file basis) --vim.opt.modelineexpr = true --vim.opt.nofoldenable = true -- turn folding off --vim.opt.foldenable = false -- turn folding off @@ -301,3 +301,21 @@ vim.cmd([[ " Return to the same line when \ endif augroup END ]]) + +-- Enable mouse scrollback +vim.cmd([[ + set mouse=a + tnoremap <Esc> <C-\><C-n> + tnoremap <c-b> <c-\><c-n> + function! ClearTerminal() + set scrollback=1 + let &g:scrollback=1 + echo &scrollback + call feedkeys("\i") + call feedkeys("clear\<CR>") + call feedkeys("\<C-\>\<C-n>") + call feedkeys("\i") + sleep 100m + let &scrollback=s:scroll_value + endfunction +]]) |
