first commit

This commit is contained in:
2026-02-13 04:20:30 +01:00
commit 2bd6b181f4
159 changed files with 194785 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
-- keep in visual mode after indenting
vim.keymap.set('v', '<', '<gv')
vim.keymap.set('v', '>', '>gv')

View File

@@ -0,0 +1,37 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
local out = vim.fn.system({ 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ 'Failed to clone lazy.nvim:\n', 'ErrorMsg' },
{ out, 'WarningMsg' },
{ '\nPress any key to exit...' },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
-- Make sure to setup `mapleader` and `maplocalleader` before
-- loading lazy.nvim so that mappings are correct.
-- This is also a good place to setup other settings (vim.opt)
vim.g.mapleader = ' '
vim.g.maplocalleader = '\\'
-- Setup lazy.nvim
require('lazy').setup({
spec = {
-- import your plugins
{ import = 'plugins' },
},
-- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { 'catppuccin' } },
-- configure ui
ui = { border = 'rounded' },
-- automatically check for plugin updates
checker = { enabled = true, notify = false },
})

View File

@@ -0,0 +1,101 @@
-- true color support
vim.o.termguicolors = true
-- fix transparency issues with alacritty
local highlights = {
'Normal',
'LineNr',
'Folded',
'NonText',
'SpecialKey',
'VertSplit',
'SignColumn',
'EndOfBuffer',
'TablineFill', -- this is specific to how I like my tabline to look like
}
for _, name in pairs(highlights) do
vim.cmd.highlight(name .. ' guibg=none ctermbg=none')
end
-- disable arrow keys
local all_modes = { 'n', 'i', 'v', 'o' }
vim.keymap.set(all_modes, '<Up>', '<Nop>', { noremap = true, silent = true })
vim.keymap.set(all_modes, '<Down>', '<Nop>', { noremap = true, silent = true })
vim.keymap.set(all_modes, '<Left>', '<Nop>', { noremap = true, silent = true })
vim.keymap.set(all_modes, '<Right>', '<Nop>', { noremap = true, silent = true })
vim.o.number = true -- display line numbers
vim.opt.clipboard:append({ 'unnamedplus', 'unnamed' }) -- always use clipboard in x11
vim.o.encoding = 'UTF-8' -- sets the character encoding used inside vim
vim.o.title = true -- when on, the title of the window will be set to the value of 'titlestring'
vim.o.signcolumn = 'yes'
-- spell checking
vim.o.spell = true
vim.opt.spelllang:append({ 'en_us', 'en_gb', 'pl' })
vim.opt.spelloptions:append({ 'camel' })
vim.o.spellcapcheck = ''
-- persistent undo
local undodir = vim.fn.stdpath('state') .. 'undo'
vim.fn.mkdir(undodir, 'p', '0700')
vim.o.undodir = undodir
vim.o.undofile = true
-- set proper file types for files in ~/ansible directory
vim.filetype.add({
pattern = {
[os.getenv('HOME') .. '/ansible/.*%.yml'] = 'yaml.ansible',
},
})
-- neovim terminal configuration
local augroup_term = vim.api.nvim_create_augroup('augroup_term', { clear = true })
vim.api.nvim_create_autocmd('TermOpen', { -- enter insert mode automatically
group = augroup_term,
pattern = '*',
callback = vim.cmd.startinsert,
})
vim.api.nvim_create_autocmd('TermOpen', { -- disable number lines on terminal buffers
group = augroup_term,
pattern = '*',
callback = function()
vim.o.number = false
vim.o.relativenumber = false
end,
})
vim.api.nvim_create_autocmd('TermOpen', { -- allow use ctrl-c on terminal windows
group = augroup_term,
pattern = '*',
callback = function(args)
vim.keymap.set('n', '<C-c>', 'i<C-c>', { buffer = args.buf })
end,
})
vim.api.nvim_create_autocmd('TermEnter', { -- no sign column
group = augroup_term,
pattern = '*',
callback = function()
vim.opt_local.signcolumn = false
end,
})
vim.keymap.set('t', '<Esc>', '<C-\\><C-n>') -- esc to exit insert mode
-- set default tab width to 4 spaces
vim.o.tabstop = 4 -- number of spaces that a tab counts for
vim.o.shiftwidth = 4 -- number of spaces that are inserted during indent operations
vim.o.softtabstop = 4 -- number of spaces that are inserted after pressing tab
vim.o.expandtab = true -- use spaces instead of tabs
-- c/c++ settings
vim.opt.cinoptions:append({ 'N-s' })
-- web dev settings
vim.g.html_indent_autotags = 'html,thead,tbody,tfoot'
vim.g.html_indent_script1 = 'auto'
vim.g.html_indent_style1 = 'auto'
-- set cursor shape to underline in the normal and command mode,
-- in the insert mode change shape to vertical bar, and disable
-- blinking in all modes
vim.opt.guicursor:append({ 'n-c:hor20', 'i:ver20', 'a:blinkon0' })