diff --git a/after/plugin/remaps.lua b/after/plugin/remaps.lua deleted file mode 100644 index 1542811..0000000 --- a/after/plugin/remaps.lua +++ /dev/null @@ -1,14 +0,0 @@ -local telescope = require('telescope.builtin') -vim.keymap.set('n', 'ff', telescope.find_files, {}) -vim.keymap.set('n', 'fg', telescope.live_grep, {}) -vim.keymap.set('n', 'fb', telescope.buffers, {}) -vim.keymap.set('n', 'fh', telescope.help_tags, {}) - - -vim.keymap.set('n', 'q', ':q', {}) -vim.keymap.set('n', 'w', ':w', {}) - -vim.keymap.set('n', 'c', ':noh', {}) - -vim.keymap.set('n', 'en', vim.diagnostic.goto_next, {}) -vim.keymap.set('n', 'ep', vim.diagnostic.goto_prev, {}) diff --git a/init.lua b/init.lua index 74f9554..9f1abcb 100644 --- a/init.lua +++ b/init.lua @@ -12,9 +12,161 @@ end vim.opt.rtp:prepend(lazypath) -vim.g.mapleader = " " +require("lazy").setup({ + spec = { + { + 'windwp/nvim-ts-autotag', + lazy = false, + config = true, + }, + { + 'terrortylor/nvim-comment', + lazy = false, + config = function() + require('nvim_comment').setup({ + hook = function() + require('ts_context_commentstring.internal').update_commentstring() + end, + }) + end, + dependencies = { + -- To customize commentstring for e.g. svelte files, as the commentstring is depending on cursor position + 'JoosepAlviste/nvim-ts-context-commentstring' + } + }, + { + { + 'williamboman/mason.nvim', + lazy = false, + config = true, + }, + { + 'williamboman/mason-lspconfig.nvim', + lazy = false, + config = function() + local lsp_zero = require('lsp-zero') -require("lazy").setup("plugins") + lsp_zero.extend_lspconfig() + + lsp_zero.on_attach(function(_, bufnr) + -- see :help lsp-zero-keybindings + -- to learn the available actions + lsp_zero.default_keymaps({ buffer = bufnr }) + end) + + require('mason-lspconfig').setup { + ensure_installed = { 'rust_analyzer', 'lua_ls' }, + handlers = { + lsp_zero.default_setup + } } + end, + }, + + { 'VonHeikemen/lsp-zero.nvim' }, + { 'neovim/nvim-lspconfig' }, + { 'hrsh7th/cmp-nvim-lsp' }, + { + 'hrsh7th/nvim-cmp', + lazy = false, + config = function() + local cmp = require('cmp') + + cmp.setup({ + mapping = cmp.mapping.preset.insert({ + -- add Ctrl+z to default keymap from lsp-zero as replacement to Ctrl+y on german keyboard layout + [''] = cmp.mapping.confirm({ select = true }), + }) + }) + end + } + }, + { + 'stevearc/conform.nvim', + lazy = false, + opts = { + notify_on_error = true, + formatters_by_ft = { + templ = { "templ" }, + }, + format_on_save = { + lsp_fallback = true, + timeout_ms = 1500, + }, + }, + config = function(_, opts) + local plug = require('conform') + plug.setup(opts) + end, + }, + { + -- status line + 'nvim-lualine/lualine.nvim', + lazy = false, + config = true, + opts = { + options = { + theme = "everforest", + }, + }, + dependencies = { 'nvim-tree/nvim-web-devicons' } + }, + { + 'rcarriga/nvim-notify', + lazy = false, + config = function() + vim.notify = require('notify') + end, + }, + { + 'stevearc/oil.nvim', + lazy = false, + config = function() + require('oil').setup({ + view_options = { + show_hidden = true, + sort = { + { "type", "asc" }, + { "name", "asc" }, + }, + }, + }) + vim.keymap.set("n", "-", "Oil", { desc = "Open parent directory" }) + end, + }, + { + 'nvim-telescope/telescope.nvim', + opts = { + defaults = { + path_display = { "smart" }, + file_ignore_patterns = { "node%_modules/.*" } + } + }, + dependencies = { 'nvim-lua/plenary.nvim' }, + }, + { + "sainnhe/everforest", + priority = 1000, -- make sure to load this before all the other start plugins + config = function() + vim.cmd([[colorscheme everforest]]) + end, + }, + { + "nvim-treesitter/nvim-treesitter", + config = function() + require("nvim-treesitter.configs").setup { + auto_install = true, + highlight = { + enable = true, + }, + } + vim.cmd([[TSUpdate]]) + end + } + } +}) + + +vim.g.mapleader = " " -- line numbers vim.opt.rnu = true @@ -28,13 +180,16 @@ vim.opt.ignorecase = true vim.opt.ts = 4 vim.opt.sw = 0 ---folding +-- folding vim.opt.foldmethod = "indent" vim.opt.foldlevel = 99 --clipboard vim.opt.clipboard = "unnamedplus" +-- other +vim.opt.signcolumn = "yes" + -- colortheme vim.opt.termguicolors = true @@ -47,3 +202,16 @@ vim.api.nvim_create_autocmd('TextYankPost', { }) vim.filetype.add({ extension = { templ = "templ" } }) + + +vim.keymap.set('n', 'q', ':q', {}) +vim.keymap.set('n', 'w', ':w', {}) +vim.keymap.set('n', 'c', ':noh', {}) +vim.keymap.set('n', 'en', vim.diagnostic.goto_next, {}) +vim.keymap.set('n', 'ep', vim.diagnostic.goto_prev, {}) + +local telescope = require('telescope.builtin') +vim.keymap.set('n', 'ff', telescope.find_files, {}) +vim.keymap.set('n', 'fg', telescope.live_grep, {}) +vim.keymap.set('n', 'fb', telescope.buffers, {}) +vim.keymap.set('n', 'fh', telescope.help_tags, {}) diff --git a/lazy-lock.json b/lazy-lock.json index 4e819ae..6bf3a38 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -2,15 +2,12 @@ "LuaSnip": { "branch": "master", "commit": "66b5c2707e624dcd2cd3605676c64a2efe47e9d1" }, "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" }, "conform.nvim": { "branch": "master", "commit": "973f3cb73887d510321653044791d7937c7ec0fa" }, - "copilot.vim": { "branch": "release", "commit": "12995dffe10282b29b8335650bf3e7457f4870e7" }, "everforest": { "branch": "master", "commit": "f40c2e6c8784c99c57c79edc94cd180e76450222" }, - "hardtime.nvim": { "branch": "main", "commit": "cde2e68986a3679e61383180e0007b3d5bc51aa7" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lsp-zero.nvim": { "branch": "v4.x", "commit": "d388e2b71834c826e61a3eba48caec53d7602510" }, "lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "a9c876d72d82b6640266f8b248ac05a63630b1d9" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "bb3a17efc797c34c054463174e5522442576ebd8" }, "mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" }, - "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, "nvim-comment": { "branch": "main", "commit": "e9ac16ab056695cad6461173693069ec070d2b23" }, "nvim-lspconfig": { "branch": "master", "commit": "7a88e3024a616e153b8760d64b3541e3a166c27f" }, diff --git a/lua/plugins/autotag.lua b/lua/plugins/autotag.lua deleted file mode 100644 index 93f2705..0000000 --- a/lua/plugins/autotag.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - 'windwp/nvim-ts-autotag', - lazy = false, - config = true, -} diff --git a/lua/plugins/comment.lua b/lua/plugins/comment.lua deleted file mode 100644 index b2a82fb..0000000 --- a/lua/plugins/comment.lua +++ /dev/null @@ -1,15 +0,0 @@ -return { - 'terrortylor/nvim-comment', - lazy = false, - config = function() - require('nvim_comment').setup({ - hook = function() - require('ts_context_commentstring.internal').update_commentstring() - end, - }) - end, - dependencies = { - -- To customize commentstring for e.g. svelte files, as the commentstring is depending on cursor position - 'JoosepAlviste/nvim-ts-context-commentstring' - } -} diff --git a/lua/plugins/conform.lua b/lua/plugins/conform.lua deleted file mode 100644 index affde11..0000000 --- a/lua/plugins/conform.lua +++ /dev/null @@ -1,18 +0,0 @@ -return { - 'stevearc/conform.nvim', - lazy = false, - opts = { - notify_on_error = true, - formatters_by_ft = { - templ = { "templ" }, - }, - format_on_save = { - lsp_fallback = true, - timeout_ms = 1500, - }, - }, - config = function(_, opts) - local plug = require('conform') - plug.setup(opts) - end, -} diff --git a/lua/plugins/copilot.lua b/lua/plugins/copilot.lua deleted file mode 100644 index 7c64703..0000000 --- a/lua/plugins/copilot.lua +++ /dev/null @@ -1,7 +0,0 @@ -return {} --- return { --- "github/copilot.vim", --- config = function() --- vim.g.copilot_filetypes = { markdown = true } --- end, --- } diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua deleted file mode 100644 index 6bdb1a2..0000000 --- a/lua/plugins/lsp.lua +++ /dev/null @@ -1,47 +0,0 @@ -return { - { - 'williamboman/mason.nvim', - lazy = false, - config = true, - }, - { - 'williamboman/mason-lspconfig.nvim', - lazy = false, - config = function() - local lsp_zero = require('lsp-zero') - - lsp_zero.extend_lspconfig() - - lsp_zero.on_attach(function(_, bufnr) - -- see :help lsp-zero-keybindings - -- to learn the available actions - lsp_zero.default_keymaps({ buffer = bufnr }) - end) - - require('mason-lspconfig').setup { - ensure_installed = { 'rust_analyzer', 'lua_ls' }, - handlers = { - lsp_zero.default_setup - } } - end, - }, - - { 'VonHeikemen/lsp-zero.nvim' }, - { 'neovim/nvim-lspconfig' }, - { 'hrsh7th/cmp-nvim-lsp' }, - { - 'hrsh7th/nvim-cmp', - lazy = false, - config = function() - local cmp = require('cmp') - - cmp.setup({ - mapping = cmp.mapping.preset.insert({ - -- add Ctrl+z to default keymap from lsp-zero as replacement to Ctrl+y on german keyboard layout - [''] = cmp.mapping.confirm({ select = true }), - }) - }) - end - }, - { 'L3MON4D3/LuaSnip' }, -} diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua deleted file mode 100644 index 5873612..0000000 --- a/lua/plugins/lualine.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - -- status line - 'nvim-lualine/lualine.nvim', - lazy = false, - config = true, - opts = { - options = { - theme = "everforest", - }, - }, - dependencies = { 'nvim-tree/nvim-web-devicons' } -} diff --git a/lua/plugins/notify.lua b/lua/plugins/notify.lua deleted file mode 100644 index 95fe768..0000000 --- a/lua/plugins/notify.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - 'rcarriga/nvim-notify', - lazy = false, - config = function() - vim.notify = require('notify') - end, -} diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua deleted file mode 100644 index 4d5488c..0000000 --- a/lua/plugins/oil.lua +++ /dev/null @@ -1,16 +0,0 @@ -return { - 'stevearc/oil.nvim', - lazy = false, - config = function() - require('oil').setup({ - view_options = { - show_hidden = true, - sort = { - { "type", "asc" }, - { "name", "asc" }, - }, - }, - }) - vim.keymap.set("n", "-", "Oil", { desc = "Open parent directory" }) - end, -} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua deleted file mode 100644 index 1537eb2..0000000 --- a/lua/plugins/telescope.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - 'nvim-telescope/telescope.nvim', - opts = { - defaults = { - path_display = { "smart" }, - file_ignore_patterns = { "node%_modules/.*" } - } - }, - dependencies = { 'nvim-lua/plenary.nvim' }, -} diff --git a/lua/plugins/theme-everforest.lua b/lua/plugins/theme-everforest.lua deleted file mode 100644 index 97f5c23..0000000 --- a/lua/plugins/theme-everforest.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - "sainnhe/everforest", - priority = 1000, -- make sure to load this before all the other start plugins - config = function() - vim.cmd([[colorscheme everforest]]) - end, -} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua deleted file mode 100644 index 8ad045d..0000000 --- a/lua/plugins/treesitter.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - "nvim-treesitter/nvim-treesitter", - config = function() - require("nvim-treesitter.configs").setup { - auto_install = true, - highlight = { - enable = true, - }, - } - vim.cmd([[TSUpdate]]) - end -}