This commit is contained in:
Omixxx 2023-03-13 10:03:12 +01:00
parent 81c3cd2ac0
commit 0ae1cf0a07
5 changed files with 802 additions and 46 deletions

View file

@ -1,8 +1,7 @@
--[[
=====================================================================
==================== READ THIS BEFORE CONTINUING ====================
=====================================================================
==================== READ THIS BEFORE CONTINUING ==================== =====================================================================
Kickctart.nvim is *not* a distribution.
@ -81,10 +80,10 @@ require('lazy').setup({
-- NOTE: This is where your plugins related to LSP can be installed.
-- The configuration is done below. Search for lspconfig to find it below.
{ -- LSP Configuration & Plugins
{
-- LSP Configuration & Plugins
'neovim/nvim-lspconfig',
dependencies = {
-- Automatically install LSPs to stdpath for neovim
@ -100,7 +99,8 @@ require('lazy').setup({
},
},
{ -- Autocompletion
{
-- Autocompletion
'hrsh7th/nvim-cmp',
dependencies = { 'hrsh7th/cmp-nvim-lsp', 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip',
'rafamadriz/friendly-snippets',
@ -110,9 +110,12 @@ require('lazy').setup({
end
},
-- Useful plugin to show you pending keybinds.
{ 'folke/which-key.nvim', opts = {} },
{ -- Adds git releated signs to the gutter, as well as utilities for managing changes
{
-- Adds git releated signs to the gutter, as well as utilities for managing changes
'lewis6991/gitsigns.nvim',
opts = {
-- See `:help gitsigns.txt`
@ -127,7 +130,8 @@ require('lazy').setup({
},
{ -- Add indentation guides even on blank lines
{
-- Add indentation guides even on blank lines
'lukas-reineke/indent-blankline.nvim',
-- Enable `lukas-reineke/indent-blankline.nvim`
-- See `:help indent_blankline.txt`
@ -138,7 +142,6 @@ require('lazy').setup({
show_current_context = true,
}
end,
},
-- "gc" to comment visual regions/lines
@ -160,7 +163,8 @@ require('lazy').setup({
end,
},
{ -- Highlight, edit, and navigate code
{
-- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter',
dependencies = {
'nvim-treesitter/nvim-treesitter-textobjects',
@ -326,6 +330,9 @@ vim.api.nvim_set_keymap('v', '<leader>v', '"_d', { noremap = true, silent = true
vim.api.nvim_set_keymap('i', '<C-k>', '<C-W>', { noremap = true, desc = "delete word" })
vim.api.nvim_set_keymap('n', '<leader>ol', ":!zathura <C-r>-expand('%:r')<cr>.pdf &<cr>",
{ noremap = true, silent = true, desc = "[O]pen [L]atex" })
-- trucco sul relplace.
-- selezionare la sezione in cui si vuole rimpiazzare una parola (si puo anche non
@ -346,13 +353,13 @@ vim.api.nvim_set_keymap('i', '<C-k>', '<C-W>', { noremap = true, desc = "delete
-- disable swap file beacause it cause crashes in neovide and neovim
vim.o.swapfile = false
-- set the default tab size to 2
vim.cmd("set shiftwidth=3")
vim.cmd("set tabstop=3")
-- changing the color mapping for the neotree mapping
vim.g.nvim_tree_highlight_opened_files = 1
-- custom requirements
config = function()
require("config.auto-session").setup {}
@ -393,8 +400,8 @@ require('telescope').setup {
defaults = {
mappings = {
i = {
['<C-u>'] = false,
['<C-d>'] = false,
['<C-u>'] = false,
['<C-d>'] = false,
},
},
},
@ -447,41 +454,41 @@ require('nvim-treesitter.configs').setup {
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',
['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',
[']m'] = '@function.outer',
[']]'] = '@class.outer',
},
goto_next_end = {
[']M'] = '@function.outer',
[']['] = '@class.outer',
[']M'] = '@function.outer',
[']['] = '@class.outer',
},
goto_previous_start = {
['[m'] = '@function.outer',
['[['] = '@class.outer',
['[m'] = '@function.outer',
['[['] = '@class.outer',
},
goto_previous_end = {
['[M'] = '@function.outer',
['[]'] = '@class.outer',
['[M'] = '@function.outer',
['[]'] = '@class.outer',
},
},
swap = {
enable = true,
swap_next = {
['<leader>a'] = '@parameter.inner',
['<leader>a'] = '@parameter.inner',
},
swap_previous = {
['<leader>A'] = '@parameter.inner',
['<leader>A'] = '@parameter.inner',
},
},
},
@ -594,14 +601,14 @@ cmp.setup {
end,
},
mapping = cmp.mapping.preset.insert {
['<C-d>'] = cmp.mapping.scroll_docs( -4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete {},
['<CR>'] = cmp.mapping.confirm {
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete {},
['<CR>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = true,
},
['<Tab>'] = cmp.mapping(function(fallback)
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
@ -610,11 +617,11 @@ cmp.setup {
fallback()
end
end, { 'i', 's' }),
['<S-Tab>'] = cmp.mapping(function(fallback)
['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable( -1) then
luasnip.jump( -1)
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end