This commit is contained in:
panisko 2025-10-27 20:56:57 +01:00 committed by GitHub
commit 8993312552
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 240 additions and 29 deletions

267
init.lua
View File

@ -1,5 +1,6 @@
--[[ --[[
===================================================================== =====================================================================
==================== READ THIS BEFORE CONTINUING ==================== ==================== READ THIS BEFORE CONTINUING ====================
===================================================================== =====================================================================
@ -102,7 +103,9 @@ vim.g.have_nerd_font = false
vim.o.number = true vim.o.number = true
-- You can also add relative line numbers, to help with jumping. -- You can also add relative line numbers, to help with jumping.
-- Experiment for yourself to see if you like it! -- Experiment for yourself to see if you like it!
-- vim.o.relativenumber = true vim.opt.relativenumber = true
--- MYEDIT
vim.opt.signcolumn = 'number'
-- Enable mouse mode, can be useful for resizing splits for example! -- Enable mouse mode, can be useful for resizing splits for example!
vim.o.mouse = 'a' vim.o.mouse = 'a'
@ -185,10 +188,10 @@ vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagn
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' }) vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
-- TIP: Disable arrow keys in normal mode -- TIP: Disable arrow keys in normal mode
-- vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>') vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
-- vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>') vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
-- vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>') vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
-- vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>') vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
-- Keybinds to make split navigation easier. -- Keybinds to make split navigation easier.
-- Use CTRL+<hjkl> to switch between windows -- Use CTRL+<hjkl> to switch between windows
@ -245,6 +248,7 @@ rtp:prepend(lazypath)
-- :Lazy update -- :Lazy update
-- --
-- NOTE: Here is where you install your plugins. -- NOTE: Here is where you install your plugins.
require('lazy').setup({ require('lazy').setup({
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
'NMAC427/guess-indent.nvim', -- Detect tabstop and shiftwidth automatically 'NMAC427/guess-indent.nvim', -- Detect tabstop and shiftwidth automatically
@ -283,7 +287,119 @@ require('lazy').setup({
}, },
}, },
}, },
-- MY CONFIG
-- {
-- 'iamcco/markdown-preview.nvim',
-- cmd = { 'MarkdownPreviewToggle', 'MarkdownPreview', 'MarkdownPreviewStop' },
-- ft = { 'markdown' },
-- build = function()
-- vim.fn['mkdp#util#install']()
-- end,
-- },
-- disable netrw at the very start of your init.lua
{
'nvim-tree/nvim-tree.lua',
config = function()
require('nvim-tree').setup {
sort = {
sorter = 'case_sensitive',
},
view = {
width = 30,
},
renderer = {
group_empty = true,
},
filters = {
dotfiles = true,
},
}
end,
},
{
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons', 'archibate/lualine-time' },
config = function()
require('lualine').setup {
options = {
icons_enabled = true,
theme = 'auto',
component_separators = { left = '', right = '' },
section_separators = { left = '', right = '' },
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = {},
always_divide_middle = true,
-- always_show_tabline = true,
globalstatus = false,
refresh = {
statusline = 100,
tabline = 100,
winbar = 100,
},
},
sections = {
lualine_a = { 'mode' },
lualine_b = { 'branch', 'diff', 'diagnostics' },
lualine_c = { 'filename' },
lualine_d = { 'lsp_progress' },
-- lualine_w = { 'tabnine' },
-- lualine_x = { 'ctime' },
lualine_y = { 'encoding', 'fileformat', 'filetype' },
lualine_z = { 'location' },
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { 'filename' },
lualine_x = { 'location' },
lualine_y = {},
lualine_z = {},
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {},
}
end,
},
{
'numToStr/Comment.nvim',
opts = {
-- add any options here
},
config = function()
require('Comment').setup()
end,
},
{ 'mbbill/undotree' },
{
'christoomey/vim-tmux-navigator',
cmd = {
'TmuxNavigateLeft',
'TmuxNavigateDown',
'TmuxNavigateUp',
'TmuxNavigateRight',
'TmuxNavigatePrevious',
},
keys = {
{ '<c-h>', '<cmd><C-U>TmuxNavigateLeft<cr>' },
{ '<c-j>', '<cmd><C-U>TmuxNavigateDown<cr>' },
{ '<c-k>', '<cmd><C-U>TmuxNavigateUp<cr>' },
{ '<c-l>', '<cmd><C-U>TmuxNavigateRight<cr>' },
{ '<c-\\>', '<cmd><C-U>TmuxNavigatePrevious<cr>' },
},
},
{
'cuducos/yaml.nvim',
ft = { 'yaml' }, -- optional
dependencies = {
'nvim-treesitter/nvim-treesitter',
'nvim-telescope/telescope.nvim', -- optional
},
},
-- NOTE: Plugins can also be configured to run Lua code when they are loaded. -- NOTE: Plugins can also be configured to run Lua code when they are loaded.
-- --
-- This is often very useful to both group configuration, as well as handle -- This is often very useful to both group configuration, as well as handle
@ -298,6 +414,8 @@ require('lazy').setup({
-- Then, because we use the `opts` key (recommended), the configuration runs -- Then, because we use the `opts` key (recommended), the configuration runs
-- after the plugin has been loaded as `require(MODULE).setup(opts)`. -- after the plugin has been loaded as `require(MODULE).setup(opts)`.
-- PLUGIN CONFIG
{ -- Useful plugin to show you pending keybinds. { -- Useful plugin to show you pending keybinds.
'folke/which-key.nvim', 'folke/which-key.nvim',
event = 'VimEnter', -- Sets the loading event to 'VimEnter' event = 'VimEnter', -- Sets the loading event to 'VimEnter'
@ -357,7 +475,9 @@ require('lazy').setup({
-- you do for a plugin at the top level, you can do for a dependency. -- you do for a plugin at the top level, you can do for a dependency.
-- --
-- Use the `dependencies` key to specify the dependencies of a particular plugin -- Use the `dependencies` key to specify the dependencies of a particular plugin
-- changed keymap
--{ vim.keymap.set('n', '<leader><F5>', vim.cmd.UndotreeToggle, { desc = 'Undo tree toggle' }) },
{ vim.keymap.set('n', '<leader>u', vim.cmd.UndotreeToggle, { desc = 'Undo tree toggle' }) },
{ -- Fuzzy Finder (files, lsp, etc) { -- Fuzzy Finder (files, lsp, etc)
'nvim-telescope/telescope.nvim', 'nvim-telescope/telescope.nvim',
event = 'VimEnter', event = 'VimEnter',
@ -475,16 +595,18 @@ require('lazy').setup({
}, },
}, },
}, },
{ 'Bilal2453/luvit-meta', lazy = true },
{ 'cespare/vim-toml' },
{ {
-- Main LSP Configuration -- Main LSP Configuration
'neovim/nvim-lspconfig', 'neovim/nvim-lspconfig',
dependencies = { dependencies = {
-- Automatically install LSPs and related tools to stdpath for Neovim -- Automatically install LSPs and related tools to stdpath for Neovim
-- Mason must be loaded before its dependents so we need to set it up here. { 'williamboman/mason.nvim', opts = { ensure_installed = { 'ansible-lint' } }, config = true },
-- NOTE: `opts = {}` is the same as calling `require('mason').setup({})` -- NOTE: Must be loaded before dependants
{ 'mason-org/mason.nvim', opts = {} }, 'williamboman/mason-lspconfig.nvim',
'mason-org/mason-lspconfig.nvim',
'WhoIsSethDaniel/mason-tool-installer.nvim', 'WhoIsSethDaniel/mason-tool-installer.nvim',
-- ADDED TO SUPPORT TOML
-- Useful status updates for LSP. -- Useful status updates for LSP.
{ 'j-hui/fidget.nvim', opts = {} }, { 'j-hui/fidget.nvim', opts = {} },
@ -626,6 +748,14 @@ require('lazy').setup({
end, end,
}) })
-- Change diagnostic symbols in the sign column (gutter)
if vim.g.have_nerd_font then
local signs = { Error = '', Warn = '', Hint = '', Info = '' }
for type, icon in pairs(signs) do
local hl = 'DiagnosticSign' .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end
end
-- Diagnostic Config -- Diagnostic Config
-- See :help vim.diagnostic.Opts -- See :help vim.diagnostic.Opts
vim.diagnostic.config { vim.diagnostic.config {
@ -654,7 +784,6 @@ require('lazy').setup({
end, end,
}, },
} }
-- LSP servers and clients are able to communicate to each other what features they support. -- LSP servers and clients are able to communicate to each other what features they support.
-- By default, Neovim doesn't support everything that is in the LSP specification. -- By default, Neovim doesn't support everything that is in the LSP specification.
-- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities. -- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities.
@ -673,7 +802,8 @@ require('lazy').setup({
local servers = { local servers = {
-- clangd = {}, -- clangd = {},
-- gopls = {}, -- gopls = {},
-- pyright = {}, pyright = {},
ansiblels = {},
-- rust_analyzer = {}, -- rust_analyzer = {},
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
-- --
@ -769,14 +899,31 @@ require('lazy').setup({
formatters_by_ft = { formatters_by_ft = {
lua = { 'stylua' }, lua = { 'stylua' },
-- Conform can also run multiple formatters sequentially -- Conform can also run multiple formatters sequentially
-- python = { "isort", "black" }, python = { 'isort', 'black' },
-- --
-- You can use 'stop_after_first' to run the first available formatter from the list -- You can use 'stop_after_first' to run the first available formatter from the list
-- javascript = { "prettierd", "prettier", stop_after_first = true }, -- javascript = { "prettierd", "prettier", stop_after_first = true },
}, },
}, },
}, },
--TABNINE
{
'codota/tabnine-nvim',
build = './dl_binaries.sh',
config = function()
require('tabnine').setup {
disable_auto_comment = true,
accept_keymap = '<Tab>',
dismiss_keymap = '<C-]>',
debounce_ms = 800,
suggestion_color = { gui = '#808080', cterm = 244 },
exclude_filetypes = { 'TelescopePrompt', 'NvimTree' },
log_file_path = nil, -- absolute path to Tabnine log file
ignore_certificate_errors = false,
}
require('tabnine.status').status()
end,
},
{ -- Autocompletion { -- Autocompletion
'saghen/blink.cmp', 'saghen/blink.cmp',
event = 'VimEnter', event = 'VimEnter',
@ -826,16 +973,50 @@ require('lazy').setup({
-- you will need to read `:help ins-completion` -- you will need to read `:help ins-completion`
-- --
-- No, but seriously. Please read `:help ins-completion`, it is really good! -- No, but seriously. Please read `:help ins-completion`, it is really good!
mapping = cmp.mapping.preset.insert {
-- Select the [n]ext item
['<C-n>'] = cmp.mapping.select_next_item(),
-- Select the [p]revious item
['<C-p>'] = cmp.mapping.select_prev_item(),
-- Scroll the documentation window [b]ack / [f]orward
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
-- Accept ([y]es) the completion.
-- This will auto-import if your LSP supports it.
-- This will expand snippets if the LSP sent a snippet.
--['<C-y>'] = cmp.mapping.confirm { select = true },
-- If you prefer more traditional completion keymaps,
-- you can uncomment the following lines
['<CR>'] = cmp.mapping.confirm { select = true },
--['<Tab>'] = cmp.mapping.select_next_item(),
--['<S-Tab>'] = cmp.mapping.select_prev_item(),
-- Manually trigger a completion from nvim-cmp.
-- Generally you don't need this, because nvim-cmp will display
-- completions whenever it has completion options available.
['<C-Space>'] = cmp.mapping.complete {},
-- Think of <c-l> as moving to the right of your snippet expansion.
-- So if you have a snippet that's like:
-- function $name($args)
-- $body
-- end
-- --
-- All presets have the following mappings: -- <c-l> will move you to the right of each of the expansion locations.
-- <tab>/<s-tab>: move to right/left of your snippet expansion -- <c-h> is similar, except moving you backwards.
-- <c-space>: Open menu or open docs if already open ['<C-l>'] = cmp.mapping(function()
-- <c-n>/<c-p> or <up>/<down>: Select next/previous item if luasnip.expand_or_locally_jumpable() then
-- <c-e>: Hide menu luasnip.expand_or_jump()
-- <c-k>: Toggle signature help end
-- end, { 'i', 's' }),
-- See :h blink-cmp-config-keymap for defining your own keymap ['<C-h>'] = cmp.mapping(function()
preset = 'default', if luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
end
end, { 'i', 's' }),
-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
@ -894,7 +1075,11 @@ require('lazy').setup({
-- Load the colorscheme here. -- Load the colorscheme here.
-- Like many other themes, this one has different styles, and you could load -- Like many other themes, this one has different styles, and you could load
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
vim.cmd.colorscheme 'tokyonight-night' --vim.cmd.colorscheme 'tokyonight-night'
vim.cmd.colorscheme 'tokyonight-storm'
-- You can configure highlights by doing something like:
vim.cmd.hi 'Comment gui=none'
end, end,
}, },
@ -944,7 +1129,26 @@ require('lazy').setup({
main = 'nvim-treesitter.configs', -- Sets main module to use for opts main = 'nvim-treesitter.configs', -- Sets main module to use for opts
-- [[ Configure Treesitter ]] See `:help nvim-treesitter` -- [[ Configure Treesitter ]] See `:help nvim-treesitter`
opts = { opts = {
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, ensure_installed = {
'regex',
'diff',
'yaml',
'toml',
'python',
'sql',
'bash',
'c',
'diff',
'html',
'lua',
'luadoc',
'markdown',
'markdown_inline',
'query',
'vim',
'vimdoc',
'java',
},
-- Autoinstall languages that are not installed -- Autoinstall languages that are not installed
auto_install = true, auto_install = true,
highlight = { highlight = {
@ -978,8 +1182,7 @@ require('lazy').setup({
-- require 'kickstart.plugins.lint', -- require 'kickstart.plugins.lint',
-- require 'kickstart.plugins.autopairs', -- require 'kickstart.plugins.autopairs',
-- require 'kickstart.plugins.neo-tree', -- require 'kickstart.plugins.neo-tree',
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
-- This is the easiest way to modularize your config. -- This is the easiest way to modularize your config.
-- --
@ -1012,5 +1215,13 @@ require('lazy').setup({
}, },
}) })
-- transparencyv
vim.api.nvim_set_hl(0, 'Normal', { bg = 'none' })
vim.api.nvim_set_hl(0, 'NormalFloat', { bg = 'none' })
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- optionally enable 24-bit colour
vim.opt.termguicolors = true
-- The line beneath this is called `modeline`. See `:help modeline` -- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et -- vim: ts=2 sts=2 sw=2 et