From 6d0613f442698b020e2df73120e67ad03764a208 Mon Sep 17 00:00:00 2001 From: servostar Date: Wed, 22 Nov 2023 18:58:50 +0100 Subject: [PATCH] removed heirline --- init.lua | 2 +- lua/config/autocmds.lua | 3 ++ lua/config/keymaps.lua | 6 ---- lua/config/language-server.lua | 17 ++++++++++ lua/config/lazy.lua | 59 ++++++++++++++++----------------- lua/plugins/bufferline.lua | 4 +-- lua/plugins/gitsigns.lua | 1 - lua/plugins/lualine.lua | 2 +- lua/plugins/navic.lua | 19 +++++++++++ lua/plugins/neo-tree.lua | 53 +++++++++++++++++++++++++++++ lua/plugins/nvim-cmp.lua | 5 ++- lua/plugins/nvim-lspconfig.lua | 9 +---- lua/plugins/nvim-scrollview.lua | 9 ++++- lua/plugins/nvim-tree.lua | 42 ----------------------- lua/plugins/smooth-scroll.lua | 5 +++ lua/plugins/symbols-outline.lua | 11 ++++++ lua/plugins/trouble.lua | 4 ++- stylua.toml | 3 ++ 18 files changed, 159 insertions(+), 95 deletions(-) create mode 100644 lua/config/language-server.lua create mode 100644 lua/plugins/navic.lua create mode 100644 lua/plugins/neo-tree.lua delete mode 100644 lua/plugins/nvim-tree.lua create mode 100644 lua/plugins/smooth-scroll.lua create mode 100644 lua/plugins/symbols-outline.lua create mode 100644 stylua.toml diff --git a/init.lua b/init.lua index 4faaaf7..2514f9e 100644 --- a/init.lua +++ b/init.lua @@ -1,2 +1,2 @@ +-- bootstrap lazy.nvim, LazyVim and your plugins require("config.lazy") -require("config.options") diff --git a/lua/config/autocmds.lua b/lua/config/autocmds.lua index e69de29..27e9e06 100644 --- a/lua/config/autocmds.lua +++ b/lua/config/autocmds.lua @@ -0,0 +1,3 @@ +-- Autocmds are automatically loaded on the VeryLazy event +-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua +-- Add any additional autocmds here diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index 75119a3..e67d896 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -5,12 +5,6 @@ map({ 'n', 'i' }, '', 'Telescope', { noremap = true }) -- save file on map({ "i", "x", "n", "s" }, "", "w", { desc = "Save file" }) --- Resize window using arrow keys -map("n", "", "resize +2", { desc = "Increase window height" }) -map("n", "", "resize -2", { desc = "Decrease window height" }) -map("n", "", "vertical resize -2", { desc = "Decrease window width" }) -map("n", "", "vertical resize +2", { desc = "Increase window width" }) - -- new file map("n", "", "enew", { desc = "New File" }) diff --git a/lua/config/language-server.lua b/lua/config/language-server.lua new file mode 100644 index 0000000..979a454 --- /dev/null +++ b/lua/config/language-server.lua @@ -0,0 +1,17 @@ +return { + lua_ls = { + mason = false + }, + bash_ls = { + mason = false, + }, + clangd = { + mason = false + }, + arduino_language_server = { + mason = false + }, + pyright = { + mason = false + }, +} diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index 0c91ef5..24e041a 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -10,7 +10,12 @@ vim.opt.rtp:prepend(vim.env.LAZY or lazypath) require("lazy").setup({ spec = { -- add LazyVim and import its plugins - "LazyVim/LazyVim", + { "LazyVim/LazyVim" }, + -- import any extras modules here + -- { import = "lazyvim.plugins.extras.lang.typescript" }, + -- { import = "lazyvim.plugins.extras.lang.json" }, + -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, + -- import/override with your plugins { import = "plugins" }, }, defaults = { @@ -20,18 +25,26 @@ require("lazy").setup({ -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, -- have outdated releases, which may break your Neovim install. version = false, -- always use the latest git commit - autocmds = true, -- lazyvim.config.autocmds - keymaps = true, -- lazyvim.config.keymaps + -- version = "*", -- try installing the latest stable version for plugins that support semver + keymaps = true, }, - news = { - -- When enabled, NEWS.md will be shown when changed. - -- This only contains big new features and breaking changes. - lazyvim = false, - -- Same but for Neovim's news.txt - neovim = false, + -- install = { colorscheme = { "tokyonight" } }, + checker = { enabled = true }, -- automatically check for plugin updates + performance = { + rtp = { + -- disable some rtp plugins + disabled_plugins = { + "gzip", + -- "matchit", + -- "matchparen", + -- "netrwPlugin", + "tarPlugin", + "tohtml", + "tutor", + "zipPlugin", + }, + }, }, - -- icons used by other plugins - -- stylua: ignore icons = { misc = { dots = "󰇘", @@ -46,13 +59,13 @@ require("lazy").setup({ diagnostics = { Error = " ", Warn = " ", - Hint = " ", + Hint = " ", Info = " ", }, git = { - added = "+", - modified = "~", - removed = "-", + added = " ", + modified = " ", + removed = " ", }, kinds = { Array = " ", @@ -96,20 +109,4 @@ require("lazy").setup({ Variable = "󰀫 ", }, }, - checker = { enabled = true }, -- automatically check for plugin updates - performance = { - rtp = { - -- disable some rtp plugins - disabled_pilugins = { - "gzip", - -- "matchit", - -- "matchparen", - -- "netrwPlugin", - "tarPlugin", - "tohtml", - "tutor", - "zipPlugin", - }, - }, - }, }) diff --git a/lua/plugins/bufferline.lua b/lua/plugins/bufferline.lua index 2f2d71d..d3fdb98 100644 --- a/lua/plugins/bufferline.lua +++ b/lua/plugins/bufferline.lua @@ -12,8 +12,8 @@ return { separator_style = { "", "" }, offsets = { { - filetype = 'NvimTree', - text = '', + filetype = 'neo-tree', + text = 'Explorer', separator = true } }, diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua index a96c47c..b0f345a 100644 --- a/lua/plugins/gitsigns.lua +++ b/lua/plugins/gitsigns.lua @@ -17,4 +17,3 @@ return { } } } - diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index 6c05953..531eaa0 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -41,7 +41,7 @@ return { }, { "diagnostics", - sources = { 'nvim_lsp' }, + sources = { 'nvim_diagnostic' }, symbols = { error = icons.diagnostics.Error, warn = icons.diagnostics.Warn, diff --git a/lua/plugins/navic.lua b/lua/plugins/navic.lua new file mode 100644 index 0000000..90dbc43 --- /dev/null +++ b/lua/plugins/navic.lua @@ -0,0 +1,19 @@ +return { + { + "SmiteshP/nvim-navic", + init = function() + vim.g.navic_silence = true + require("lazyvim.util").lsp.on_attach(function(client, buffer) + if client.supports_method("textDocument/documentSymbol") then + require("nvim-navic").attach(client, buffer) + end + end) + end, + opts = { + highlight = true, + icons = require("lazyvim.config").icons.kinds, + separator = "  ", + depth_limit = 5, + } + } +} diff --git a/lua/plugins/neo-tree.lua b/lua/plugins/neo-tree.lua new file mode 100644 index 0000000..49450f5 --- /dev/null +++ b/lua/plugins/neo-tree.lua @@ -0,0 +1,53 @@ +return { + { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended + "MunifTanjim/nui.nvim", + -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information + }, + opts = { + popup_border_style = "rounded", + enable_git_status = true, + enable_diagnostics = true, + open_files_do_not_replace_types = { "terminal", "trouble", "qf" }, -- when opening files, do not use windows containing these filetypes or buftypes + default_component_configs = { + indent = { + indent_size = 2, + padding = 1, -- extra padding on left hand side + -- indent guides + with_markers = true, + indent_marker = "│", + last_indent_marker = "└", + highlight = "NeoTreeIndentMarker", + -- expander config, needed for nesting files + with_expanders = true, -- if nil and file nesting is enabled, will enable expanders + expander_collapsed = "", + expander_expanded = "", + expander_highlight = "NeoTreeExpander", + }, + git_status = { + symbols = { + -- Change type + added = "", -- or "✚", but this is redundant info if you use git_status_colors on the name + modified = "", -- or "", but this is redundant info if you use git_status_colors on the name + deleted = "", -- this can only be used in the git_status source + renamed = "󰁕", -- this can only be used in the git_status source + -- Status type + untracked = "", + ignored = "", + unstaged = "󰄱 ", + staged = " ", + conflict = " ", + } + }, + modified = { + symbol = "+", + highlight = "NeoTreeModified", + }, + } + } + } +} diff --git a/lua/plugins/nvim-cmp.lua b/lua/plugins/nvim-cmp.lua index 33a628e..1ac4cf5 100644 --- a/lua/plugins/nvim-cmp.lua +++ b/lua/plugins/nvim-cmp.lua @@ -16,6 +16,9 @@ return { }, completion = { completeopt = "menu,menuone,noinsert", + winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None", + col_offset = -3, + side_padding = 0, }, snippet = { expand = function(args) @@ -67,7 +70,7 @@ return { "hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-buffer", "hrsh7th/cmp-path", - "hrsh7th/cmp-path", + 'hrsh7th/cmp-cmdline', "saadparwaiz1/cmp_luasnip", } } diff --git a/lua/plugins/nvim-lspconfig.lua b/lua/plugins/nvim-lspconfig.lua index 527f0b4..a0083d1 100644 --- a/lua/plugins/nvim-lspconfig.lua +++ b/lua/plugins/nvim-lspconfig.lua @@ -39,14 +39,7 @@ return { formatting_options = nil, timeout_ms = nil, }, - servers = { - lua_ls = { - mason = false - }, - rust_analyzer = { - mason = false - }, - }, + servers = require("config.language-server"), setup = { } }, diff --git a/lua/plugins/nvim-scrollview.lua b/lua/plugins/nvim-scrollview.lua index 2668b5b..9622421 100644 --- a/lua/plugins/nvim-scrollview.lua +++ b/lua/plugins/nvim-scrollview.lua @@ -5,6 +5,13 @@ return { excluded_filetypes = { 'dashboard' }, + signs_on_startup = { + 'conflicts', + 'diagnostics', + 'search', + 'cursor' + }, } } -} \ No newline at end of file +} + diff --git a/lua/plugins/nvim-tree.lua b/lua/plugins/nvim-tree.lua deleted file mode 100644 index 5d632d6..0000000 --- a/lua/plugins/nvim-tree.lua +++ /dev/null @@ -1,42 +0,0 @@ -return { - { - "nvim-tree/nvim-tree.lua", - opts = { - hijack_cursor = true, - renderer = { - full_name = true, - group_empty = true, - special_files = {}, - symlink_destination = false, - indent_markers = { - enable = true, - }, - icons = { - git_placement = "signcolumn", - show = { - file = true, - folder = true, - folder_arrow = true, - git = true, - }, - }, - }, - update_focused_file = { - enable = true, - update_root = true, - ignore_list = { "help" }, - }, - diagnostics = { - enable = true, - show_on_dirs = true, - icons = { - hint = "", - info = "", - warning = "", - error = "", - } - }, - } - }, - -} \ No newline at end of file diff --git a/lua/plugins/smooth-scroll.lua b/lua/plugins/smooth-scroll.lua new file mode 100644 index 0000000..ff0e7db --- /dev/null +++ b/lua/plugins/smooth-scroll.lua @@ -0,0 +1,5 @@ +return { + { + "karb94/neoscroll.nvim" + } +} diff --git a/lua/plugins/symbols-outline.lua b/lua/plugins/symbols-outline.lua new file mode 100644 index 0000000..98db369 --- /dev/null +++ b/lua/plugins/symbols-outline.lua @@ -0,0 +1,11 @@ +return { + { + 'simrat39/symbols-outline.nvim', + opts = { + show_guides = true, + fold_markers = { '', '' }, + autofold_depth = 3, + show_symbol_details = false + } + } +} diff --git a/lua/plugins/trouble.lua b/lua/plugins/trouble.lua index b525180..5a25a61 100644 --- a/lua/plugins/trouble.lua +++ b/lua/plugins/trouble.lua @@ -2,6 +2,8 @@ return { { "folke/trouble.nvim", opts = { + use_diagnostic_signs = true }, } -} \ No newline at end of file +} + diff --git a/stylua.toml b/stylua.toml new file mode 100644 index 0000000..e55efd5 --- /dev/null +++ b/stylua.toml @@ -0,0 +1,3 @@ +indent_type = "Spaces" +indent_width = 4 +column_width = 120