nvf time!
This commit is contained in:
parent
216904f679
commit
86977f4ecf
57 changed files with 4076 additions and 217 deletions
17
modules/editors/nvf/lua/display/mouse.lua
Normal file
17
modules/editors/nvf/lua/display/mouse.lua
Normal file
|
@ -0,0 +1,17 @@
|
|||
-- disable the "how to disable mouse" message
|
||||
-- in right click popups
|
||||
vim.cmd.aunmenu([[PopUp.How-to\ disable\ mouse]])
|
||||
vim.cmd.aunmenu([[PopUp.-1-]])
|
||||
|
||||
vim.cmd.amenu([[PopUp.Inspect <Cmd>Inspect<CR>]])
|
||||
vim.cmd.amenu([[PopUp.Telescope <Cmd>Telescope<CR>]])
|
||||
vim.cmd.amenu([[PopUp.Code\ action <Cmd>lua vim.lsp.buf.code_action()<CR>]])
|
||||
vim.cmd.amenu([[PopUp.LSP\ Hover <Cmd>lua vim.lsp.buf.hover()<CR>]])
|
||||
|
||||
-- Add a blinking cursor in certain modes.
|
||||
vim.opt.guicursor = {
|
||||
'n-c-v:block-Cursor',
|
||||
'i-ci-ve-r-o:blinkwait250-blinkon250-blinkoff250-Cursor',
|
||||
'i-ci-ve:ver25-Cursor',
|
||||
'r-cr-o:hor20-Cursor',
|
||||
}
|
30
modules/editors/nvf/lua/display/numbertoggle.lua
Normal file
30
modules/editors/nvf/lua/display/numbertoggle.lua
Normal file
|
@ -0,0 +1,30 @@
|
|||
-- alias for vim.api.nvim_create_autocmd
|
||||
local create_autocmd = vim.api.nvim_create_autocmd
|
||||
-- alias for vim.api.nvim_create_augroup
|
||||
local create_augroup = vim.api.nvim_create_augroup
|
||||
|
||||
-- taken from https://github.com/sitiom/nvim-numbertoggle
|
||||
-- I would much rather avoid fetching yet another plugin for something
|
||||
-- that should be done locally - and not as a plugin
|
||||
local augroup = create_augroup('NumberToggle', {})
|
||||
|
||||
create_autocmd({ 'BufEnter', 'FocusGained', 'InsertLeave', 'CmdlineLeave', 'WinEnter' }, {
|
||||
pattern = '*',
|
||||
group = augroup,
|
||||
callback = function()
|
||||
if vim.o.nu and vim.api.nvim_get_mode().mode ~= 'i' then
|
||||
vim.opt.relativenumber = true
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
create_autocmd({ 'BufLeave', 'FocusLost', 'InsertEnter', 'CmdlineEnter', 'WinLeave' }, {
|
||||
pattern = '*',
|
||||
group = augroup,
|
||||
callback = function()
|
||||
if vim.o.nu then
|
||||
vim.opt.relativenumber = false
|
||||
vim.cmd('redraw')
|
||||
end
|
||||
end,
|
||||
})
|
3
modules/editors/nvf/lua/display/split.lua
Normal file
3
modules/editors/nvf/lua/display/split.lua
Normal file
|
@ -0,0 +1,3 @@
|
|||
-- More natural pane splitting
|
||||
vim.o.splitbelow = true
|
||||
vim.o.splitright = true
|
93
modules/editors/nvf/lua/display/ui.lua
Normal file
93
modules/editors/nvf/lua/display/ui.lua
Normal file
|
@ -0,0 +1,93 @@
|
|||
local opt = vim.opt
|
||||
|
||||
-- luacheck: ignore
|
||||
-- When true, all the windows are automatically made the same size after splitting or closing a window.
|
||||
-- When false, splitting a window will reduce the size of the current window and leave the other windows the same.
|
||||
opt.equalalways = false
|
||||
opt.cmdheight = 1 -- Better display for messages
|
||||
opt.colorcolumn = '+0' -- Align text at 'textwidth'
|
||||
opt.showtabline = 2 -- Always show the tabs line
|
||||
opt.helpheight = 0 -- Disable help window resizing
|
||||
opt.winwidth = 30 -- Minimum width for active window
|
||||
opt.winminwidth = 1 -- Minimum width for inactive windows
|
||||
opt.winheight = 1 -- Minimum height for active window
|
||||
opt.winminheight = 1 -- Minimum height for inactive window
|
||||
opt.pumheight = 10 -- Maximum number of items to show in the popup menu
|
||||
opt.winminwidth = 1 -- min width of inactive window
|
||||
-- opt.pumblend = 100 -- Popup blend, 100 means transparent
|
||||
|
||||
opt.cursorline = true
|
||||
opt.whichwrap:append('<,>,h,l,[,]')
|
||||
|
||||
opt.list = true
|
||||
-- haracters to fill the statuslines, vertical separators and special
|
||||
-- lines in the window.opt.whichwrap:append('<,>,h,l,[,]')
|
||||
opt.fillchars:append({
|
||||
-- replace window border with slightly thicker characters
|
||||
-- although taking a bit of more space, it helps me better
|
||||
-- identify the window borders
|
||||
horiz = '━',
|
||||
horizup = '┻',
|
||||
horizdown = '┳',
|
||||
vert = '┃',
|
||||
vertleft = '┫',
|
||||
vertright = '┣',
|
||||
verthoriz = '╋',
|
||||
|
||||
eob = ' ', -- suppress end of buffer lines (~)
|
||||
diff = '╱', -- deleted lines of the 'diff' option
|
||||
|
||||
msgsep = '‾',
|
||||
|
||||
-- replace fold chars
|
||||
fold = ' ',
|
||||
foldopen = '',
|
||||
foldclose = '',
|
||||
})
|
||||
|
||||
-- List chars that would b shown on all modes
|
||||
-- better kept simple, because it gets REALLY
|
||||
-- noisy in an average buffer
|
||||
local normal_listchars = {
|
||||
extends = '›', -- Alternatives: … ,»
|
||||
precedes = '‹', -- Alternatives: … ,«
|
||||
}
|
||||
|
||||
opt.listchars = normal_listchars
|
||||
|
||||
-- Show listchars while in Insert mode.
|
||||
local insert_listchars = {
|
||||
eol = nil,
|
||||
tab = '▎·',
|
||||
lead = '·',
|
||||
space = '·',
|
||||
trail = '.',
|
||||
multispace = '… ',
|
||||
nbsp = '¤',
|
||||
}
|
||||
|
||||
-- Show listchars while in Insert mode.
|
||||
vim.api.nvim_create_augroup('InsertModeListChars', { clear = true })
|
||||
vim.api.nvim_create_autocmd({ 'InsertEnter', 'InsertLeavePre' }, {
|
||||
group = 'InsertModeListChars',
|
||||
pattern = '*',
|
||||
callback = function(args)
|
||||
if vim.tbl_contains({ 'quickfix', 'prompt' }, args.match) then
|
||||
return
|
||||
end
|
||||
|
||||
if args.event == 'InsertEnter' then
|
||||
vim.opt_local.listchars = insert_listchars
|
||||
else
|
||||
vim.opt_local.listchars = normal_listchars
|
||||
end
|
||||
|
||||
-- check if ibl is enabled
|
||||
-- @diagnostic disable-next-line: no-unknown, unused-local
|
||||
local status_ok, ibl = pcall(require, 'ibl')
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
require('ibl').debounced_refresh(0)
|
||||
end,
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue