diff --git a/init.lua b/init.lua index 188e5c3..f5b328a 100644 --- a/init.lua +++ b/init.lua @@ -21,4 +21,4 @@ vim.opt.rtp:prepend(lazypath) require("vim-options") require("lazy").setup("plugins") - +require("current-theme") diff --git a/lazy-lock.json b/lazy-lock.json index 852639b..6e3d42f 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,5 +1,6 @@ { "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, + "catppuccin": { "branch": "main", "commit": "f67b886d65a029f12ffa298701fb8f1efd89295d" }, "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, @@ -9,18 +10,18 @@ "mason-lspconfig.nvim": { "branch": "main", "commit": "e942edf5c85b6a2ab74059ea566cac5b3e1514a4" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "e6645ecfcba3e064446a6def1c10d788c9873f51" }, - "none-ls-extras.nvim": { "branch": "main", "commit": "6557f20e631d2e9b2a9fd27a5c045d701a3a292c" }, - "none-ls.nvim": { "branch": "main", "commit": "3291afdff94e5083c7d6a4e9e661c3682c4b9b2a" }, + "none-ls.nvim": { "branch": "main", "commit": "af318216b744f2fe2d5afa6febb01f455ae61d6c" }, "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" }, "nvim-cmp": { "branch": "main", "commit": "8c82d0bd31299dbff7f8e780f5e06d2283de9678" }, "nvim-dap": { "branch": "master", "commit": "99807078c5089ed30e0547aa4b52c5867933f426" }, "nvim-dap-ui": { "branch": "master", "commit": "727c032a8f63899baccb42a1c26f27687e62fc5e" }, "nvim-lspconfig": { "branch": "master", "commit": "339ccc81e08793c3af9b83882a6ebd90c9cc0d3b" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, - "nvim-treesitter": { "branch": "master", "commit": "fd59f984416f696d85119fd4d15ce0965b179944" }, + "nvim-treesitter": { "branch": "master", "commit": "5da195ac3dfafd08d8b10756d975f0e01e1d563a" }, "nvim-web-devicons": { "branch": "master", "commit": "aafa5c187a15701a7299a392b907ec15d9a7075f" }, "omnisharp-extended-lsp.nvim": { "branch": "main", "commit": "ec1a2431f8872f650a85ed71c24f0715df2e49c2" }, "plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" }, + "telescope-themes": { "branch": "main", "commit": "9b7c368b83b82b53c0a6e9e977f8329e5f1fe269" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" } } diff --git a/lua/current-theme.lua b/lua/current-theme.lua new file mode 100644 index 0000000..7530c79 --- /dev/null +++ b/lua/current-theme.lua @@ -0,0 +1 @@ +vim.cmd("colorscheme github_dark") \ No newline at end of file diff --git a/lua/plugins/completions.lua b/lua/plugins/completions.lua index 752cc63..4902546 100644 --- a/lua/plugins/completions.lua +++ b/lua/plugins/completions.lua @@ -12,13 +12,15 @@ return { { "hrsh7th/nvim-cmp", config = function() + local luasnip = require("luasnip") local cmp = require("cmp") + require("luasnip.loaders.from_vscode").lazy_load() cmp.setup({ snippet = { expand = function(args) - require("luasnip").lsp_expand(args.body) + luasnip.lsp_expand(args.body) end, }, window = { @@ -26,21 +28,39 @@ return { documentation = cmp.config.window.bordered(), }, mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping.confirm({ + behavior = cmp.ConfirmBehavior.Replace, + select = true, + }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), }), - sources = cmp.config.sources( - { + sources = cmp.config.sources({ { name = "nvim_lsp" }, { name = "luasnip" }, - }, - { + }, { { name = "buffer" }, }), }) - end - } + end, + }, } diff --git a/lua/plugins/github-theme.lua b/lua/plugins/github-theme.lua deleted file mode 100644 index 0887dfa..0000000 --- a/lua/plugins/github-theme.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - 'projekt0n/github-nvim-theme', - name = 'github-theme', - config = function() - vim.cmd('colorscheme github_dark_dimmed') - end -} diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 8a0fac8..370b110 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -27,12 +27,12 @@ return { command = "EslintFixAll", }) end, - on_new_config = function (config, new_root_dir) - config.settings.workspaceFolder = { - uri = vim.uri_from_fname(new_root_dir), - name = vim.fn.fnamemodify(new_root_dir, ':t'), - } - end + on_new_config = function(config, new_root_dir) + config.settings.workspaceFolder = { + uri = vim.uri_from_fname(new_root_dir), + name = vim.fn.fnamemodify(new_root_dir, ":t"), + } + end, }) lspconfig.omnisharp.setup({ @@ -61,6 +61,7 @@ return { }) lspconfig.html.setup({ + filetypes = { "html", "ejs" }, capabilities = capabilities, }) @@ -81,12 +82,14 @@ return { omnisharp.lsp_definition, { desc = "Go to definition", buffer = ev.buf } ) + vim.keymap.set( "n", "gi", omnisharp.lsp_implementation, { desc = "Go to implementation", buffer = ev.buf } ) + vim.keymap.set( "n", "D", @@ -100,12 +103,14 @@ return { vim.lsp.buf.definition, { desc = "Go to definition", buffer = ev.buf } ) + vim.keymap.set( "n", "gD", vim.lsp.buf.declaration, { desc = "Go to declaration", buffer = ev.buf } ) + vim.keymap.set( "n", "gi", diff --git a/lua/plugins/neotree.lua b/lua/plugins/neotree.lua index 19d9eda..c013d24 100644 --- a/lua/plugins/neotree.lua +++ b/lua/plugins/neotree.lua @@ -1,13 +1,19 @@ return { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", - "MunifTanjim/nui.nvim", - }, - config = function() - vim.keymap.set('n', '', ':Neotree filesystem reveal right', { desc = 'Neotree show explorer' }) - end + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", + }, + config = function() + require("neo-tree").setup({ + filesystem = { + filtered_items = { + visible = true, + } + } + }) + vim.keymap.set("n", "", ":Neotree filesystem reveal right", { desc = "Neotree show explorer" }) + end, } - diff --git a/lua/plugins/none-ls.lua b/lua/plugins/none-ls.lua index 539edab..5eaffc0 100644 --- a/lua/plugins/none-ls.lua +++ b/lua/plugins/none-ls.lua @@ -10,7 +10,6 @@ return { null_ls.builtins.formatting.black, null_ls.builtins.formatting.isort, null_ls.builtins.diagnostics.pylint, - null_ls.builtins.completion.spell, } }) diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index b5db38b..32dcf15 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -26,5 +26,11 @@ return { require("telescope").load_extension("ui-select") end + }, + { + 'andrew-george/telescope-themes', + config = function() + require('telescope').load_extension('themes') + end } } diff --git a/lua/plugins/themes.lua b/lua/plugins/themes.lua new file mode 100644 index 0000000..8476f2c --- /dev/null +++ b/lua/plugins/themes.lua @@ -0,0 +1,20 @@ +return { + { + "projekt0n/github-nvim-theme", + name = "github-theme", + lazy = false, + priority = 1000, + config = function() + require("github-theme").setup() + end + }, + { + "catppuccin/nvim", + name = "catppuccin", + lazy = false, + priority = 1000, + config = function() + require("catppuccin").setup() + end + }, +} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index c9f94e3..bb71b02 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,13 +1,14 @@ -return { - "nvim-treesitter/nvim-treesitter", +return { + "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", config = function() local config = require("nvim-treesitter.configs") - + config.setup({ auto_install = true, indent = { enabled = true }, - highlight = { enabled = true } + highlight = { enabled = true }, }) - end + + end, }