lsp config

This commit is contained in:
godot 2024-04-20 22:50:58 +02:00
parent 008c0ded74
commit 1f06341766
7 changed files with 68 additions and 24 deletions

5
.luarc.json Normal file
View File

@ -0,0 +1,5 @@
{
"diagnostics.globals": [
"vim"
]
}

View File

@ -1,26 +1,43 @@
## Used plugins
- https://github.com/folke/lazy.nvim (plugin manager)
### Ricing plugins
- https://github.com/neanias/everforest-nvim (colour scheme)
- https://github.com/catppuccin/nvim?tab=readme-ov-file (colour scheme)
- https://github.com/nvim-lualine/lualine.nvim (status bar)
- https://github.com/nvim-telescope/telescope.nvim (fuzzy finder)
### Basic utilitiy plugins
- https://github.com/nvim-telescope/telescope.nvim (fuzzy finder
- https://github.com/nvim-telescope/telescope-ui-select.nvim (ui for code actions)
)
- https://github.com/nvim-treesitter/nvim-treesitter (tree sitter plugin old)
- https://github.com/nvim-neo-tree/neo-tree.nvim (map of filesystem)
- https://github.com/christoomey/vim-tmux-navigator (tmux integration)
#### Old plugins
### LSP plugins
- https://github.com/williamboman/mason.nvim (lsp manager)
- https://github.com/williamboman/mason-lspconfig.nvim (messenger)
- https://github.com/neovim/nvim-lspconfig (neovim side)
- https://github.com/LuaLS/lua-language-server (lua lsp)
- html-lsp over mason
- https://github.com/artempyanykh/marksman (markdown lsp)
- https://github.com/typescript-language-server/typescript-language-server (javascript and typescript lsp)
### Old plugins
- https://github.com/catppuccin/nvim?tab=readme-ov-file (colour scheme)
### Tutorials used
## Tutorials used
- [YT - typecraft serie](https://www.youtube.com/watch?v=zHTeCSVAFNY&list=PLsz00TDipIffreIaUNk64KxTIkQaGguqn)
- [Primegeon](https://www.youtube.com/watch?v=w7i4amO_zaE&t=81s)
## Cool plugins to add
### Cool plugins to study
- https://github.com/epwalsh/obsidian.nvim (Obsidian in Nvim)
- https://github.com/Feel-ix-343/markdown-oxide?tab=readme-ov-file (lsp that makes Obsidian from .md)
### Tutorials foud
## Tutorials foud
## Ideas to do
- multiple buffers open in one widnow
- multiple buffers open in one widnow (posible with vim "<C-w>+v")
- move lualine on the top

View File

@ -13,16 +13,12 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
end
vim.opt.rtp:prepend(lazypath)
-- Configuration of plugins --
local opts = {}
-- Runs plugins --
require("lazy").setup("plugins") -- packet manager --
local builtin = require("telescope.builtin") -- fuzzy finder --
-- local builtin = require("telescope.builtin") -- fuzzy finder --
local config = require("nvim-treesitter.configs") -- tree sitter plugin config for langs --
config.setup({
@ -34,7 +30,7 @@ config.setup({
highlight = { enable = true },
indent = { enable = true },
})
require("everforest").setup({}) --color scheme
vim.cmd.colorscheme "everforest"
@ -49,8 +45,6 @@ require('lualine').setup{
-- Keypams --
vim.keymap.set('n', '<C-p>', builtin.find_files, {}) -- telescope find
-- vim.keymap.set('n', '<C-o>', builtin.live_grep, {}) -- I dont know what this is doing?
vim.keymap.set('n', '<C-m>', ':Neotree filesystem toggle left<CR>', {})

View File

@ -1,16 +1,13 @@
{
"everforest": { "branch": "main", "commit": "5e0e32a569fb464911342f0d421721cc1c94cf25" },
"image.nvim": { "branch": "master", "commit": "301de7919b2c0378cb7a782663f67abbcb198b17" },
"lazy.nvim": { "branch": "main", "commit": "31ddbea7c10b6920c9077b66c97951ca8682d5c8" },
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "44509689b9bf3984d729cc264aacb31cb7f41668" },
"mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "7aad1bf3f6b849cbf108e02c55ad4d701cb4d33a" },
"nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" },
"nvim-lspconfig": { "branch": "master", "commit": "ed8b8a15acc441aec669f97d75f2c1f2ac8c8aa5" },
"nvim-treesitter": { "branch": "master", "commit": "ea4f6d5175812a3f48302d638a766bc18fcbb04a" },
"nvim-web-devicons": { "branch": "master", "commit": "31ba3c489e56a7f20881cee013cea1269b6b2f2d" },
"plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" },
"vim-tmux-navigator": { "branch": "master", "commit": "a26954a585b02a2ac02f87145e204f8798a7cbc2" }
}

View File

@ -1,8 +1,5 @@
return {
{'nvim-telescope/telescope.nvim', tag = '0.1.6', -- fuzzy finder (telescope) --
dependencies = { 'nvim-lua/plenary.nvim' }},
{"nvim-treesitter/nvim-treesitter", build = ":TSUpdate"}, -- tree sitter --
{"nvim-neo-tree/neo-tree.nvim",branch = "v3.x", -- map of filesystem

View File

@ -8,15 +8,24 @@ return {
{"williamboman/mason-lspconfig.nvim", -- mason configuration lsp
config = function()
require("mason-lspconfig").setup({
ensure_installed = { "lua_ls" }
ensure_installed = { "lua_ls",
"tsserver", "html",
"marksman"}
})
end
},
{"neovim/nvim-lspconfig",
{"neovim/nvim-lspconfig", -- nvim vrstva ktera implemetuje zmeny
config = function()
local lspconfig = require("lspconfig")
lspconfig.lua_ls.setup({})
lspconfig.lua_ls.setup({}) -- lua
lspconfig.marksman.setup({})
lspconfig.tsserver.setup({}) -- js
lspconfig.html.setup({}) -- html
vim.keymap.set('n', 'K', vim.lsp.buf.hover, {})
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, {})
vim.keymap.set({'n', 'v'}, '<space>ca', vim.lsp.buf.code_action, opts)
end
}
}

25
lua/plugins/telescope.lua Normal file
View File

@ -0,0 +1,25 @@
return {
{
"nvim-telescope/telescope-ui-select.nvim",
},
{
"nvim-telescope/telescope.nvim",
tag = "0.1.5",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
require("telescope").setup({
extensions = {
["ui-select"] = {
require("telescope.themes").get_dropdown({}),
},
},
})
local builtin = require("telescope.builtin")
vim.keymap.set("n", "<C-p>", builtin.find_files, {})
vim.keymap.set("n", "<leader>fg", builtin.live_grep, {})
vim.keymap.set("n", "<leader><leader>", builtin.oldfiles, {})
require("telescope").load_extension("ui-select")
end,
},
}