fix: small improvements

This commit is contained in:
2026-09-11 21:32:43 +02:00
parent 8292ff741d
commit 1cf3eef5e9
6 changed files with 81 additions and 36 deletions
+21 -20
View File
@@ -1,28 +1,29 @@
-- General
vim.g.mapleader = ' ' -- Use `<Space>` as <Leader> key
vim.o.undofile = true -- Enable persistent undo
vim.o.shada = "'100,<50,s10,:1000,/100,@100,h" -- Limit ShaDa file (for startup)
vim.o.shada = "'50,<20,s10,:100,/50,@50,h" -- Limit ShaDa file (for startup)
-- UI
vim.o.breakindent = true -- Indent wrapped lines to match line start
vim.o.breakindentopt = 'list:-1' -- Add padding for lists (if 'wrap' is set)
vim.o.cursorline = true -- Enable current line highlighting
vim.o.linebreak = true -- Wrap lines at 'breakat' (if 'wrap' is set)
vim.o.list = true -- Show helpful text indicators
vim.o.number = true -- Show line numbers
vim.o.pumheight = 10 -- Make popup menu smaller
vim.o.pummaxwidth = 80 -- Make popup menu not too wide
vim.o.shortmess = 'CFOSWacou' -- Disable some built-in completion messages
vim.o.signcolumn = 'yes' -- Always show signcolumn (less flicker)
vim.o.splitbelow = true -- Horizontal splits will be below
vim.o.splitkeep = 'screen' -- Reduce scroll during window split
vim.o.splitright = true -- Vertical splits will be to the right
vim.o.wrap = false -- Don't visually wrap lines
vim.o.winborder = 'rounded' -- Use border in floating windows
vim.o.pumborder = 'rounded' -- Use border in popup menu
vim.o.cmdheight = 0 -- Hide the command line when not in use
vim.cmd('syntax off') -- Disable legacy syntax highlighting
require('vim._core.ui2').enable({ -- Enable new ui (requires nightly)
vim.o.breakindent = true -- Indent wrapped lines to match line start
vim.o.breakindentopt = 'list:-1' -- Add padding for lists (if 'wrap' is set)
vim.o.cursorline = true -- Enable current line highlighting
vim.o.linebreak = true -- Wrap lines at 'breakat' (if 'wrap' is set)
vim.o.list = true -- Show helpful text indicators
vim.o.listchars = 'tab:→ ,trail:·,nbsp:␣' -- Characters for list mode
vim.o.number = true -- Show line numbers
vim.o.pumheight = 10 -- Make popup menu smaller
vim.o.pummaxwidth = 80 -- Make popup menu not too wide
vim.o.shortmess = 'CFOSWacou' -- Disable some built-in completion messages
vim.o.signcolumn = 'yes' -- Always show signcolumn (less flicker)
vim.o.splitbelow = true -- Horizontal splits will be below
vim.o.splitkeep = 'screen' -- Reduce scroll during window split
vim.o.splitright = true -- Vertical splits will be to the right
vim.o.wrap = false -- Don't visually wrap lines
vim.o.winborder = 'rounded' -- Use border in floating windows
vim.o.pumborder = 'rounded' -- Use border in popup menu
vim.o.cmdheight = 0 -- Hide the command line when not in use
vim.cmd('syntax off') -- Disable legacy syntax highlighting
require('vim._core.ui2').enable({ -- Enable new ui (requires nightly)
msg = { targets = 'msg' }
})
+3 -1
View File
@@ -58,7 +58,8 @@ end
nmap_leader('ed', '<Cmd>lua MiniFiles.open()<CR>', 'Directory')
nmap_leader('ef', explore_at_file, 'File directory')
nmap_leader('ey', '<Cmd>lua vim.fn.setreg("+", vim.api.nvim_buf_get_name(0))<CR>', 'Yank absolute path')
nmap_leader('ey', '<Cmd>lua vim.fn.setreg("+", vim.fn.fnamemodify(vim.api.nvim_buf_get_name(0), ":."))<CR>', 'Yank absolute path')
nmap_leader('eY', '<Cmd>lua vim.fn.setreg("+", vim.api.nvim_buf_get_name(0))<CR>', 'Yank relative path')
nmap_leader('en', '<Cmd>messages<CR>', 'Notifications')
-- Find
@@ -74,6 +75,7 @@ nmap_leader('fh', '<Cmd>Pick help<CR>', 'Help tags')
nmap_leader('fl', '<Cmd>Pick buf_lines scope="all"<CR>', 'Lines (all)')
nmap_leader('fL', '<Cmd>Pick buf_lines scope="current"<CR>', 'Lines (buf)')
nmap_leader('fm', '<Cmd>Pick git_status<CR>', 'Modified / changed files')
nmap_leader('fo', '<Cmd>Pick oldfiles<CR>', 'Old / recent files')
nmap_leader('fr', '<Cmd>Pick resume<CR>', 'Resume')
nmap_leader('fs', '<Cmd>Pick lsp scope="workspace_symbol_live"<CR>', 'Symbols workspace')
nmap_leader('fS', '<Cmd>Pick lsp scope="document_symbol"<CR>', 'Symbols document')
+11 -2
View File
@@ -12,7 +12,16 @@ Config.now(function()
return vim.iter({ vim.fn.glob('~/Code/*', 0, 1), vim.fn.glob('~/Documents/*/*', 0, 1) })
:flatten()
:filter(function(p) return vim.fn.isdirectory(p) == 1 end)
:map(function(p) return { name = vim.fn.fnamemodify(p, ':t'), action = 'edit ' .. vim.fn.fnameescape(p), section = 'Projects' } end)
:map(function(p)
return {
name = vim.fn.fnamemodify(p, ':t'),
action = function()
vim.fn.chdir(p)
require('mini.files').open(p)
end,
section = 'Projects',
}
end)
:totable()
end,
@@ -47,7 +56,7 @@ Config.later(function()
{ mode = { 'n', 'x' }, keys = 'g' },
{ mode = { 'n', 'x' }, keys = "'" },
{ mode = { 'n', 'x' }, keys = '`' },
{ mode = { 'n', 'x' }, keys = "'" },
{ mode = { 'n', 'x' }, keys = '"' },
{ mode = { 'i', 'c' }, keys = '<C-r>' },
{ mode = 'n', keys = '<C-w>' },
{ mode = { 'n', 'x' }, keys = 's' },
+15 -4
View File
@@ -9,6 +9,8 @@ end)
-- Treesitter
Config.now_if_args(function()
vim.treesitter.language.register('bash', 'sh')
vim.treesitter.language.register('tsx', 'typescriptreact')
local filetypes = {
'html', 'css', 'lua', 'go', 'php', 'blade', 'sql', 'javascript',
@@ -23,10 +25,19 @@ Config.now_if_args(function()
end, 'Start tree-sitter')
Config.later(function()
vim.pack.add({ 'https://github.com/nvim-treesitter/nvim-treesitter' })
require('nvim-treesitter').install(vim.tbl_map(function(ft)
return vim.treesitter.language.get_lang(ft) or ft
end, filetypes))
local missing = {}
for _, ft in ipairs(filetypes) do
local lang = vim.treesitter.language.get_lang(ft) or ft
if #vim.api.nvim_get_runtime_file('parser/' .. lang .. '.so', false) == 0 then
table.insert(missing, lang)
end
end
if #missing > 0 then
vim.pack.add({ 'https://github.com/nvim-treesitter/nvim-treesitter' })
require('nvim-treesitter').install(missing)
end
end)
end)