new config

This commit is contained in:
Dario48true 2025-02-03 10:21:51 +01:00
parent ee2563cac6
commit e3d3ab6680
36 changed files with 262 additions and 611 deletions

39
lua/plugins/lspconfig.lua Normal file
View file

@ -0,0 +1,39 @@
return {
"neovim/nvim-lspconfig",
dependencies = {
{'hrsh7th/cmp-nvim-lsp'},
{'hrsh7th/nvim-cmp'},
},
config = function()
-- Reserve a space in the gutter
-- This will avoid an annoying layout shift in the screen
vim.opt.signcolumn = 'yes'
-- Add cmp_nvim_lsp capabilities settings to lspconfig
-- This should be executed before you configure any language server
local lspconfig_defaults = require('lspconfig').util.default_config
lspconfig_defaults.capabilities = vim.tbl_deep_extend(
'force',
lspconfig_defaults.capabilities,
require('cmp_nvim_lsp').default_capabilities()
)
vim.api.nvim_create_autocmd('LspAttach', {
desc = 'LSP actions',
callback = function(event)
local opts = {buffer = event.buf}
vim.keymap.set('n', 'K', function () vim.lsp.buf.hover() end, opts)
vim.keymap.set('n', 'gd', function () vim.lsp.buf.definition() end, opts)
vim.keymap.set('n', 'gD', function () vim.lsp.buf.declaration() end, opts)
vim.keymap.set('n', 'gi', function () vim.lsp.buf.implementation() end, opts)
vim.keymap.set('n', 'go', function () vim.lsp.buf.type_definition() end, opts)
vim.keymap.set('n', 'gr', function () vim.lsp.buf.references() end, opts)
vim.keymap.set('n', 'gs', function () vim.lsp.buf.signature_help() end, opts)
vim.keymap.set('n', '<F2>', function () vim.lsp.buf.rename() end, opts)
vim.keymap.set({'n', 'x'}, '<F3>', function () vim.lsp.buf.format({async = true}) end, opts)
vim.keymap.set('n', '<F4>', function () vim.lsp.buf.code_action() end, opts)
end,
})
end
}

25
lua/plugins/mason.lua Normal file
View file

@ -0,0 +1,25 @@
return {
{
"williamboman/mason.nvim",
dependencies = {"williamboman/mason-lspconfig.nvim"},
keys = {
{ "<leader>m", ":Mason <CR>", desc = "open mason" },
},
config = true;
},
{
"williamboman/mason-lspconfig.nvim",
opts = {
-- Replace the language servers listed here
-- with the ones you want to install
ensure_installed = {'lua_ls', 'pyright'},
handlers = {
function(server_name)
require('lspconfig')[server_name].setup({})
end,
},
}
},
}

37
lua/plugins/neorg.lua Normal file
View file

@ -0,0 +1,37 @@
return {
"nvim-neorg/neorg",
lazy = true, -- Disable lazy loading as some `lazy.nvim` distributions set `lazy = true` by default
dependencies = {
{
"juniorsundar/neorg-extras",
-- tag = "v0.3.1" -- Always a safe bet to track current latest release
},
"nvim-telescope/telescope.nvim", -- Required for the Neorg-Roam features
"nvim-lua/plenary.nvim", -- Required as part of Telescope installation
},
opts = {
load = {
["external.many-mans"] = {
config = {
metadata_fold = true, -- If want @data property ... @end to fold
code_fold = true, -- If want @code ... @end to fold
}
},
["core.defaults"] = {},
["core.concealer"] = { config = { folds = false } },
["core.dirman"] = {
config = {
workspaces = {
school = "~/Documents/school",
notes = "~/Documents/notes",
},
default_workspace = "notes",
},
},
["core.completion"] = { config = { engine = "nvim-cmp" } },
},
},
ft = "norg",
cmd = "Neorg",
config = true,
}

6
lua/plugins/nightfox.lua Normal file
View file

@ -0,0 +1,6 @@
return {
"EdenEast/nightfox.nvim",
init = function()
vim.cmd("colorscheme carbonfox")
end
}

33
lua/plugins/nvim-cmp.lua Normal file
View file

@ -0,0 +1,33 @@
return {
"hrsh7th/nvim-cmp",
dependencies = {
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-path',
'hrsh7th/cmp-cmdline',
'neovim/nvim-lspconfig'
},
config= function()
local cmp = require('cmp')
cmp.setup({
sources = {
{name = 'nvim_lsp'},
{ name = "neorg" },
},
snippet = {
expand = function(args)
-- You need Neovim v0.10 to use vim.snippet
vim.snippet.expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
['<C-Space>'] = cmp.mapping.complete(),
['<S-NL>'] = cmp.mapping.scroll_docs(-4),
['<C-S-K>'] = cmp.mapping.scroll_docs(-4),
[' '] = cmp.mapping.confirm(),
['<CR>'] = cmp.mapping.confirm({ select = true }),
}),
})
end
}

View file

@ -0,0 +1,39 @@
return {
"nvim-treesitter/nvim-treesitter",
opts = {
-- A list of parser names, or "all" (the listed parsers MUST always be installed)
ensure_installed = { "c", "lua", "norg"},
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = true,
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = true,
-- List of parsers to ignore installing (or "all")
---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
highlight = {
enable = true,
-- NOTE: these are the names of the parsers and not the filetype. (for example if you want to
-- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is
-- the name of the parser)
-- list of language that will be disabled
-- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
indent = {
enable = true,
disable = {"norg"}
},
},
config = true,
}

View file

@ -0,0 +1,5 @@
return {
"luk400/vim-jukit",
lazu = true,
ft = "ipynb",
}

View file

@ -0,0 +1,3 @@
return {
"folke/which-key.nvim",
}