Skip to content

Commit

Permalink
Added custom config file
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiblt1304 committed Jun 26, 2024
1 parent 5e43123 commit 2b354c0
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 6 deletions.
9 changes: 4 additions & 5 deletions init.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
--[[
=====================================================================
==================== READ THIS BEFORE CONTINUING ====================
=====================================================================
Expand Down Expand Up @@ -42,7 +41,6 @@ What is Kickstart?
- (or HTML version): https://neovim.io/doc/user/lua-guide.html
Kickstart Guide:
TODO: The very first thing you should do is to run the command `:Tutor` in Neovim.
If you don't know what this means, type the following:
Expand Down Expand Up @@ -162,8 +160,6 @@ vim.opt.hlsearch = true
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')

-- Diagnostic keymaps
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' })
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' })
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' })
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })

Expand Down Expand Up @@ -222,9 +218,12 @@ vim.opt.rtp:prepend(lazypath)
--
-- To update plugins you can run
-- :Lazy update
--

local custom_plugins = require 'custom.plugins.init'

-- NOTE: Here is where you install your plugins.
require('lazy').setup({
custom_plugins,
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically

Expand Down
71 changes: 70 additions & 1 deletion lua/custom/plugins/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,73 @@
-- I promise not to create any merge conflicts in this directory :)
--
-- See the kickstart.nvim README for more information
return {}
return {
{
'nvim-neo-tree/neo-tree.nvim',
branch = 'v2.x',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
'MunifTanjim/nui.nvim',
},
config = function()
-- require('neo-tree').setup {
-- -- your config options here
-- filesystem = {
-- follow_current_file = true,
-- hijack_netrw_behavior = 'open_default',
-- use_libuv_file_watcher = true,
-- },
-- }
end,
},
{
'neovim/nvim-lspconfig',
dependencies = {
'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim',
'lvimuser/lsp-inlayhints.nvim',
},
config = function()
-- Set up mason
require('mason').setup()
require('mason-lspconfig').setup {
ensure_installed = { 'rust_analyzer' }, -- Add other LSP servers here
}

local lspconfig = require 'lspconfig'
local inlayhints = require 'lsp-inlayhints'

-- Enable inlay hints for Rust Analyzer
lspconfig.rust_analyzer.setup {
settings = {
['rust-analyzer'] = {
inlayHints = {
enable = true,
typeHints = true,
parameterHints = true,
chainingHints = true,
},
},
},
on_attach = function(client, bufnr)
inlayhints.on_attach(client, bufnr)
end,
}

-- Add additional LSP server configurations here

-- Enable inlay hints for other servers if supported
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
if client.server_capabilities.inlayHintProvider then
vim.lsp.inlay_hint(args.buf, true)
end
-- other lsp configurations you might want
end,
})
end,
},
}

0 comments on commit 2b354c0

Please sign in to comment.