1
0
Fork 0

nvim config updates

This commit is contained in:
Arthur K. 2026-01-30 15:47:24 +03:00
parent 559939e2f4
commit adc494721a
Signed by: wzray
GPG key ID: B97F30FDC4636357
20 changed files with 1108 additions and 30 deletions

View file

@ -30,9 +30,24 @@ local filetypes = {
for ext, ft in pairs(filetypes) do
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
pattern = "*." .. ext,
callback = function()
vim.bo.filetype = ft
end,
pattern = "*." .. ext,
callback = function()
vim.bo.filetype = ft
end,
})
end
local spell_filetypes = {
'markdown',
'text',
'gitcommit'
}
for _, ext in ipairs(spell_filetypes) do
vim.api.nvim_create_autocmd('FileType', {
pattern = ext,
callback = function()
vim.cmd 'setlocal spell'
end,
})
end

View file

@ -16,8 +16,11 @@ map({ 'n', 'v' }, '<A-u>', ':bp<CR>', { silent = true })
map({ 'n', 'v' }, '<A-i>', ':bn<CR>', { silent = true })
-- Remap for dealing with word wrap
map({ 'n', 'v' }, 'k', 'v:count == 0 ? "gk" : "k"', { expr = true, silent = true })
map({ 'n', 'v' }, 'j', 'v:count == 0 ? "gj" : "j"', { expr = true, silent = true })
map({ 'n', 'v' }, 'k', 'v:count == 0 ? "gk" : "k"', { expr = true, silent = true })
map({ 'n', 'v' }, 'о', 'v:count == 0 ? "gj" : "j"', { expr = true, silent = true })
map({ 'n', 'v' }, 'л', 'v:count == 0 ? "gk" : "k"', { expr = true, silent = true })
-- Duplicate leader feats to gradually move to
@ -27,6 +30,11 @@ map({ 'n', 'v' }, '<leader>Y', '"+y$')
map({ 'n', 'v' }, '<leader>p', '"+p<ESC>')
map({ 'n', 'v' }, '<leader>P', '"+P<ESC>')
map({ 'n', 'v' }, '<leader>н', '"+y')
map({ 'n', 'v' }, '<leader>н', '"+y$')
map({ 'n', 'v' }, '<leader>з', '"+p<ESC>')
map({ 'n', 'v' }, '<leader>З', '"+P<ESC>')
-- buffer size
map({ 'n', 'v' }, '<leader>n', '<C-w>10<')
map({ 'n', 'v' }, '<leader>m', '<C-w>10>')

View file

@ -35,4 +35,28 @@ vim.o.timeoutlen = 300
vim.o.splitbelow = true
vim.o.splitright = true
vim.diagnostic.config({ virtual_text = true })
vim.diagnostic.config({
virtual_text = true,
signs = true,
virtual_lines = false,
update_in_insert = true,
float = {
source = 'if_many',
format = function(d)
return ("[%d:%d] %s"):format(
d.lnum + 1,
d.end_col + 1,
d.message
)
end,
}
})
-- fold related stuff
vim.o.foldcolumn = '0'
vim.o.foldlevel = 99
vim.o.foldlevelstart = 99
vim.o.foldenable = true
-- spelling
vim.o.spelllang = 'en,ru'