global: rewrite the minimal config file

Co-Authored-by: iGor milhit <igor@milhit.ch>
main
iGor milhit 2024-08-11 08:05:58 +02:00
parent fe25313c23
commit 484594cde7
Signed by: igor
GPG Key ID: 692D97C3D0228A99
1 changed files with 17 additions and 115 deletions

132
minit.lua
View File

@ -7,6 +7,15 @@
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
-- Minimal options
-- Display relative line numbers
-- Except to the active line
vim.opt.relativenumber = true
vim.opt.number = true
-- Enable mouse mode
vim.opt.mouse = 'a'
-- Install package manager
-- https://github.com/folke/lazy.nvim
-- `:help lazy.nvim.txt` for more info
@ -25,120 +34,13 @@ vim.opt.rtp:prepend(lazypath)
require('lazy').setup({
{
"Mofiqul/adwaita.nvim",
lazy = false,
priority = 1000,
config = function()
vim.cmd('colorscheme adwaita')
end
},
-- {
-- "Mofiqul/adwaita.nvim",
-- lazy = false,
-- priority = 1000,
-- config = function()
-- vim.cmd('colorscheme adwaita')
-- end
-- },
{
-- Set lualine as statusline
'nvim-lualine/lualine.nvim',
-- See `:help lualine.txt`
opts = {
options = {
icons_enabled = true,
theme = 'adwaita',
component_separators = '|',
section_separators = '',
},
},
},
{
-- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter',
dependencies = {
'nvim-treesitter/nvim-treesitter-textobjects',
},
build = ':TSUpdate',
}
})
vim.wo.number = true
-- [[ Configure Treesitter ]]
-- See `:help nvim-treesitter`
require('nvim-treesitter.configs').setup {
-- Add languages to be installed here that you want installed for treesitter
ensure_installed = { },
-- Do not install parses synchronously
sync_install = false,
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
auto_install = false,
-- List of parsers to ignore installing
-- ignore_install = { "markdown" },
-- Required property, but empty
modules = {},
highlight = {
enable = true,
},
indent = { enable = true, disable = { 'python' } },
incremental_selection = {
enable = true,
keymaps = {
init_selection = '<c-space>',
node_incremental = '<c-space>',
scope_incremental = '<c-s>',
node_decremental = '<M-space>',
},
},
textobjects = {
select = {
enable = true,
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
keymaps = {
-- You can use the capture groups defined in textobjects.scm
['aa'] = '@parameter.outer',
['ia'] = '@parameter.inner',
['af'] = '@function.outer',
['if'] = '@function.inner',
['ac'] = '@class.outer',
['ic'] = '@class.inner',
},
},
move = {
enable = true,
set_jumps = true, -- whether to set jumps in the jumplist
goto_next_start = {
[']m'] = '@function.outer',
[']]'] = '@class.outer',
},
goto_next_end = {
[']M'] = '@function.outer',
[']['] = '@class.outer',
},
goto_previous_start = {
['[m'] = '@function.outer',
['[['] = '@class.outer',
},
goto_previous_end = {
['[M'] = '@function.outer',
['[]'] = '@class.outer',
},
},
swap = {
enable = true,
swap_next = {
['<leader>a'] = '@parameter.inner',
},
swap_previous = {
['<leader>A'] = '@parameter.inner',
},
},
},
}
-- Diagnostic keymaps
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' })
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' })
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' })
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })