From f70e031d85ad5983815823b2510369b51b0ca200 Mon Sep 17 00:00:00 2001 From: Florian Feigl Date: Thu, 25 Jan 2024 01:21:08 +0100 Subject: [PATCH] Cleaning up before editing. --- backup/onedark.lua.theme | 12 --- lazy-lock.json | 3 +- lua/custom/plugins/*/plugins/autocomplete.lua | 16 ---- lua/custom/plugins/*/plugins/autoformat.lua | 74 -------------- lua/custom/plugins/*/plugins/debug.lua | 87 ----------------- lua/custom/plugins/*/plugins/gruvbox.lua | 10 -- lua/custom/plugins/*/plugins/lsp-config.lua | 15 --- lua/custom/plugins/*/plugins/lualine.lua | 13 --- lua/custom/plugins/*/plugins/neo-tree.lua | 16 ---- lua/custom/plugins/*/plugins/none-ls.lua | 14 --- lua/custom/plugins/*/plugins/telescope.lua | 96 ------------------- lua/custom/plugins/*/plugins/treesitter.lua | 84 ---------------- lua/custom/plugins/*/plugins/vim-settings.lua | 6 -- lua/plugins/lualine.lua | 5 +- lua/plugins/none-ls.lua | 4 +- 15 files changed, 6 insertions(+), 449 deletions(-) delete mode 100644 backup/onedark.lua.theme delete mode 100644 lua/custom/plugins/*/plugins/autocomplete.lua delete mode 100644 lua/custom/plugins/*/plugins/autoformat.lua delete mode 100644 lua/custom/plugins/*/plugins/debug.lua delete mode 100644 lua/custom/plugins/*/plugins/gruvbox.lua delete mode 100644 lua/custom/plugins/*/plugins/lsp-config.lua delete mode 100644 lua/custom/plugins/*/plugins/lualine.lua delete mode 100644 lua/custom/plugins/*/plugins/neo-tree.lua delete mode 100644 lua/custom/plugins/*/plugins/none-ls.lua delete mode 100644 lua/custom/plugins/*/plugins/telescope.lua delete mode 100644 lua/custom/plugins/*/plugins/treesitter.lua delete mode 100644 lua/custom/plugins/*/plugins/vim-settings.lua diff --git a/backup/onedark.lua.theme b/backup/onedark.lua.theme deleted file mode 100644 index d7b44b21..00000000 --- a/backup/onedark.lua.theme +++ /dev/null @@ -1,12 +0,0 @@ -return { - -- Theme inspired by Atom - 'navarasu/onedark.nvim', - priority = 1000, - config = function() - require('onedark').setup { - style = 'warm', - } - require('onedark').load() - vim.cmd.colorscheme 'onedark' - end, -} diff --git a/lazy-lock.json b/lazy-lock.json index 9ce8a51f..d1679360 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -4,6 +4,7 @@ "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "everforest": { "branch": "master", "commit": "89080db9637bb297b4c75ae1511e9f6f61ad9c78" }, "fidget.nvim": { "branch": "main", "commit": "3a93300c076109d86c7ce35ec67a8034ae6ba9db" }, "friendly-snippets": { "branch": "main", "commit": "69a2c1675b66e002799f5eef803b87a12f593049" }, "gitsigns.nvim": { "branch": "main", "commit": "4aaacbf5e5e2218fd05eb75703fe9e0f85335803" }, @@ -24,9 +25,7 @@ "nvim-dap-ui": { "branch": "master", "commit": "7e5e16427aaf814dc2d58e1b219def9ef2fa2435" }, "nvim-lspconfig": { "branch": "master", "commit": "e47ccfae775f0d572ef0f3a7d245f043b259dafc" }, "nvim-treesitter": { "branch": "master", "commit": "8cd2b230174efbf7b5d9f49fe2f90bda6b5eb16e" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "85b9d0cbd4ff901abcda862b50dbb34e0901848b" }, "nvim-web-devicons": { "branch": "master", "commit": "db0c864375c198cacc171ff373e76bfce2a85045" }, - "onedark.nvim": { "branch": "master", "commit": "dc3bad0121298f89b50aaff8599d1946e07eb4c2" }, "plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, "telescope.nvim": { "branch": "0.1.x", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, diff --git a/lua/custom/plugins/*/plugins/autocomplete.lua b/lua/custom/plugins/*/plugins/autocomplete.lua deleted file mode 100644 index 2d3b9832..00000000 --- a/lua/custom/plugins/*/plugins/autocomplete.lua +++ /dev/null @@ -1,16 +0,0 @@ -return { - -- Autocompletion - 'hrsh7th/nvim-cmp', - dependencies = { - -- Snippet Engine & its associated nvim-cmp source - 'L3MON4D3/LuaSnip', - 'saadparwaiz1/cmp_luasnip', - - -- Adds LSP completion capabilities - 'hrsh7th/cmp-nvim-lsp', - 'hrsh7th/cmp-path', - - -- Adds a number of user-friendly snippets - 'rafamadriz/friendly-snippets', - }, -} diff --git a/lua/custom/plugins/*/plugins/autoformat.lua b/lua/custom/plugins/*/plugins/autoformat.lua deleted file mode 100644 index bc56b15b..00000000 --- a/lua/custom/plugins/*/plugins/autoformat.lua +++ /dev/null @@ -1,74 +0,0 @@ --- autoformat.lua --- --- Use your language server to automatically format your code on save. --- Adds additional commands as well to manage the behavior - -return { - 'neovim/nvim-lspconfig', - config = function() - -- Switch for controlling whether you want autoformatting. - -- Use :KickstartFormatToggle to toggle autoformatting on or off - local format_is_enabled = true - vim.api.nvim_create_user_command('KickstartFormatToggle', function() - format_is_enabled = not format_is_enabled - print('Setting autoformatting to: ' .. tostring(format_is_enabled)) - end, {}) - - -- Create an augroup that is used for managing our formatting autocmds. - -- We need one augroup per client to make sure that multiple clients - -- can attach to the same buffer without interfering with each other. - local _augroups = {} - local get_augroup = function(client) - if not _augroups[client.id] then - local group_name = 'kickstart-lsp-format-' .. client.name - local id = vim.api.nvim_create_augroup(group_name, { clear = true }) - _augroups[client.id] = id - end - - return _augroups[client.id] - end - - -- Whenever an LSP attaches to a buffer, we will run this function. - -- - -- See `:help LspAttach` for more information about this autocmd event. - vim.api.nvim_create_autocmd('LspAttach', { - group = vim.api.nvim_create_augroup('kickstart-lsp-attach-format', { clear = true }), - -- This is where we attach the autoformatting for reasonable clients - callback = function(args) - local client_id = args.data.client_id - local client = vim.lsp.get_client_by_id(client_id) - local bufnr = args.buf - - -- Only attach to clients that support document formatting - if not client.server_capabilities.documentFormattingProvider then - return - end - - -- Tsserver usually works poorly. Sorry you work with bad languages - -- You can remove this line if you know what you're doing :) - if client.name == 'tsserver' then - return - end - - -- Create an autocmd that will run *before* we save the buffer. - -- Run the formatting command for the LSP that has just attached. - vim.api.nvim_create_autocmd('BufWritePre', { - group = get_augroup(client), - buffer = bufnr, - callback = function() - if not format_is_enabled then - return - end - - vim.lsp.buf.format { - async = false, - filter = function(c) - return c.id == client.id - end, - } - end, - }) - end, - }) - end, -} diff --git a/lua/custom/plugins/*/plugins/debug.lua b/lua/custom/plugins/*/plugins/debug.lua deleted file mode 100644 index 7fc783fa..00000000 --- a/lua/custom/plugins/*/plugins/debug.lua +++ /dev/null @@ -1,87 +0,0 @@ --- debug.lua --- --- Shows how to use the DAP plugin to debug your code. --- --- Primarily focused on configuring the debugger for Go, but can --- be extended to other languages as well. That's why it's called --- kickstart.nvim and not kitchen-sink.nvim ;) - -return { - -- NOTE: Yes, you can install new plugins here! - 'mfussenegger/nvim-dap', - -- NOTE: And you can specify dependencies as well - dependencies = { - -- Creates a beautiful debugger UI - 'rcarriga/nvim-dap-ui', - - -- Installs the debug adapters for you - 'williamboman/mason.nvim', - 'jay-babu/mason-nvim-dap.nvim', - - -- Add your own debuggers here - 'leoluz/nvim-dap-go', - }, - config = function() - local dap = require 'dap' - local dapui = require 'dapui' - - require('mason-nvim-dap').setup { - -- Makes a best effort to setup the various debuggers with - -- reasonable debug configurations - automatic_setup = true, - - -- You can provide additional configuration to the handlers, - -- see mason-nvim-dap README for more information - handlers = {}, - - -- You'll need to check that you have the required things installed - -- online, please don't ask me how to install them :) - ensure_installed = { - -- Update this to ensure that you have the debuggers for the langs you want - 'delve', - }, - } - - -- Basic debugging keymaps, feel free to change to your liking! - vim.keymap.set('n', '', dap.continue, { desc = 'Debug: Start/Continue' }) - vim.keymap.set('n', '', dap.step_into, { desc = 'Debug: Step Into' }) - vim.keymap.set('n', '', dap.step_over, { desc = 'Debug: Step Over' }) - vim.keymap.set('n', '', dap.step_out, { desc = 'Debug: Step Out' }) - vim.keymap.set('n', 'b', dap.toggle_breakpoint, { desc = 'Debug: Toggle Breakpoint' }) - vim.keymap.set('n', 'B', function() - dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ') - end, { desc = 'Debug: Set Breakpoint' }) - - -- Dap UI setup - -- For more information, see |:help nvim-dap-ui| - dapui.setup { - -- Set icons to characters that are more likely to work in every terminal. - -- Feel free to remove or use ones that you like more! :) - -- Don't feel like these are good choices. - icons = { expanded = '▾', collapsed = '▸', current_frame = '*' }, - controls = { - icons = { - pause = '⏸', - play = '▶', - step_into = '⏎', - step_over = '⏭', - step_out = '⏮', - step_back = 'b', - run_last = '▶▶', - terminate = '⏹', - disconnect = '⏏', - }, - }, - } - - -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. - vim.keymap.set('n', '', dapui.toggle, { desc = 'Debug: See last session result.' }) - - dap.listeners.after.event_initialized['dapui_config'] = dapui.open - dap.listeners.before.event_terminated['dapui_config'] = dapui.close - dap.listeners.before.event_exited['dapui_config'] = dapui.close - - -- Install golang specific config - require('dap-go').setup() - end, -} diff --git a/lua/custom/plugins/*/plugins/gruvbox.lua b/lua/custom/plugins/*/plugins/gruvbox.lua deleted file mode 100644 index f1383067..00000000 --- a/lua/custom/plugins/*/plugins/gruvbox.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - 'ellisonleao/gruvbox.nvim', - priority = 1000, - -- config = true, - opts = ..., - config = function() - vim.o.background = 'dark' - vim.cmd [[colorscheme gruvbox]] - end, -} diff --git a/lua/custom/plugins/*/plugins/lsp-config.lua b/lua/custom/plugins/*/plugins/lsp-config.lua deleted file mode 100644 index 97568066..00000000 --- a/lua/custom/plugins/*/plugins/lsp-config.lua +++ /dev/null @@ -1,15 +0,0 @@ -return { - -- LSP Configuration & Plugins - 'neovim/nvim-lspconfig', - dependencies = { - -- Automatically install LSPs to stdpath for neovim - { 'williamboman/mason.nvim', config = true }, - 'williamboman/mason-lspconfig.nvim', - - -- Useful status updates for LSP - { 'j-hui/fidget.nvim', opts = {} }, - - -- Additional lua configuration, makes nvim stuff amazing! - 'folke/neodev.nvim', - }, -} diff --git a/lua/custom/plugins/*/plugins/lualine.lua b/lua/custom/plugins/*/plugins/lualine.lua deleted file mode 100644 index 82bce4ed..00000000 --- a/lua/custom/plugins/*/plugins/lualine.lua +++ /dev/null @@ -1,13 +0,0 @@ -return { - -- Set lualine as statusline - 'nvim-lualine/lualine.nvim', - -- See `:help lualine.txt` - opts = { - options = { - icons_enabled = false, - theme = 'onedark', - component_separators = '|', - section_separators = '', - }, - }, -} diff --git a/lua/custom/plugins/*/plugins/neo-tree.lua b/lua/custom/plugins/*/plugins/neo-tree.lua deleted file mode 100644 index 4dacd80b..00000000 --- a/lua/custom/plugins/*/plugins/neo-tree.lua +++ /dev/null @@ -1,16 +0,0 @@ -return { - 'nvim-neo-tree/neo-tree.nvim', - branch = 'v3.x', - dependencies = { - 'nvim-lua/plenary.nvim', - 'nvim-tree/nvim-web-devicons', - 'MunifTanjim/nui.nvim', - '3rd/image.nvim', - }, - keys = { - { '', 'Neotree toggle', desc = '[F]iles with Neotree' }, - -- config = function() - -- require("neo-tree").setup() - -- end, - }, -} diff --git a/lua/custom/plugins/*/plugins/none-ls.lua b/lua/custom/plugins/*/plugins/none-ls.lua deleted file mode 100644 index 2b40c809..00000000 --- a/lua/custom/plugins/*/plugins/none-ls.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - 'nvimtools/none-ls.nvim', - config = function() - local null_ls = require 'null-ls' - null_ls.setup { - sources = { - null_ls.builtins.formatting.stylua, - null_ls.builtins.diagnostics.eslint, - null_ls.builtins.completion.spell, - }, - } - vim.keymap.set('n', 'cf', vim.lsp.buf.format, { desc = '[C]ode [f]ormatting' }) - end, -} diff --git a/lua/custom/plugins/*/plugins/telescope.lua b/lua/custom/plugins/*/plugins/telescope.lua deleted file mode 100644 index 417cb527..00000000 --- a/lua/custom/plugins/*/plugins/telescope.lua +++ /dev/null @@ -1,96 +0,0 @@ -return { - 'nvim-telescope/telescope.nvim', - branch = '0.1.x', - dependencies = { - 'nvim-lua/plenary.nvim', - { - 'nvim-telescope/telescope-fzf-native.nvim', - build = 'make', - cond = function() - return vim.fn.executable 'make' == 1 - end, - }, - }, - config = function() - -- [[ Configure Telescope ]] - -- See `:help telescope` and `:help telescope.setup()` - local telescope = require 'telescope' - telescope.setup { - defaults = { - mappings = { - i = { - [''] = false, - [''] = false, - }, - }, - }, - } - -- Enable telescope fzf native, if installed - pcall(require('telescope').load_extension, 'fzf') - - -- Telescope live_grep in git root - -- Function to find the git root directory based on the current buffer's path - local function find_git_root() - -- Use the current buffer's path as the starting point for the git search - local current_file = vim.api.nvim_buf_get_name(0) - local current_dir - local cwd = vim.fn.getcwd() - -- If the buffer is not associated with a file, return nil - if current_file == '' then - current_dir = cwd - else - -- Extract the directory from the current file's path - current_dir = vim.fn.fnamemodify(current_file, ':h') - end - - -- Find the Git root directory from the current file's path - local git_root = vim.fn.systemlist('git -C ' .. vim.fn.escape(current_dir, ' ') .. ' rev-parse --show-toplevel') - [1] - if vim.v.shell_error ~= 0 then - print 'Not a git repository. Searching on current working directory' - return cwd - end - return git_root - end - - -- Custom live_grep function to search in git root - local function live_grep_git_root() - local git_root = find_git_root() - if git_root then - require('telescope.builtin').live_grep { - search_dirs = { git_root }, - } - end - end - - vim.api.nvim_create_user_command('LiveGrepGitRoot', live_grep_git_root, {}) - - -- See `:help telescope.builtin` - vim.keymap.set('n', '?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' }) - vim.keymap.set('n', '', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' }) - vim.keymap.set('n', '/', function() - -- You can pass additional configuration to telescope to change theme, layout, etc. - require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { - winblend = 10, - previewer = false, - }) - end, { desc = '[/] Fuzzily search in current buffer' }) - - local function telescope_live_grep_open_files() - require('telescope.builtin').live_grep { - grep_open_files = true, - prompt_title = 'Live Grep in Open Files', - } - end - vim.keymap.set('n', 's/', telescope_live_grep_open_files, { desc = '[S]earch [/] in Open Files' }) - vim.keymap.set('n', 'ss', require('telescope.builtin').builtin, { desc = '[S]earch [S]elect Telescope' }) - vim.keymap.set('n', 'gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' }) - vim.keymap.set('n', 'sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' }) - vim.keymap.set('n', 'sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' }) - vim.keymap.set('n', 'sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' }) - vim.keymap.set('n', 'sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) - vim.keymap.set('n', 'sG', ':LiveGrepGitRoot', { desc = '[S]earch by [G]rep on Git Root' }) - vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) - vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' }) - end, -} diff --git a/lua/custom/plugins/*/plugins/treesitter.lua b/lua/custom/plugins/*/plugins/treesitter.lua deleted file mode 100644 index b84e972e..00000000 --- a/lua/custom/plugins/*/plugins/treesitter.lua +++ /dev/null @@ -1,84 +0,0 @@ -return { - { - 'nvim-treesitter/nvim-treesitter', - run = ':TSUpdate', -- This command is run after installation to update Treesitter parsers - config = function() - require('nvim-treesitter.configs').setup { - -- Add languages to be installed here that you want installed for Treesitter - ensure_installed = { 'lua', 'python', 'rust', 'markdown', 'vimdoc', 'vim', 'bash' }, - - -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) - auto_install = true, - - -- Install languages synchronously (only applied to `ensure_installed`) - sync_install = false, - - -- List of parsers to ignore installing - ignore_install = { '' }, - - highlight = { - enable = true, -- false will disable the whole extension - }, - - indent = { - enable = true, -- Indentation based on treesitter for supported languages - }, - - incremental_selection = { - enable = true, - keymaps = { - init_selection = '', - node_incremental = '', - scope_incremental = '', - node_decremental = '', - }, - }, - - textobjects = { - select = { - enable = true, - lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim - keymaps = { - -- You can use the capture groups defined in textobjects.scm - ['aa'] = '@parameter.outer', - ['ia'] = '@parameter.inner', - ['af'] = '@function.outer', - ['if'] = '@function.inner', - ['ac'] = '@class.outer', - ['ic'] = '@class.inner', - }, - }, - move = { - enable = true, - set_jumps = true, -- whether to set jumps in the jumplist - goto_next_start = { - [']m'] = '@function.outer', - [']]'] = '@class.outer', - }, - goto_next_end = { - [']M'] = '@function.outer', - [']['] = '@class.outer', - }, - goto_previous_start = { - ['[m'] = '@function.outer', - ['[['] = '@class.outer', - }, - goto_previous_end = { - ['[M'] = '@function.outer', - ['[]'] = '@class.outer', - }, - }, - swap = { - enable = true, - swap_next = { - ['a'] = '@parameter.inner', - }, - swap_previous = { - ['A'] = '@parameter.inner', - }, - }, - }, - } - end, - }, -} diff --git a/lua/custom/plugins/*/plugins/vim-settings.lua b/lua/custom/plugins/*/plugins/vim-settings.lua deleted file mode 100644 index 19cdb84e..00000000 --- a/lua/custom/plugins/*/plugins/vim-settings.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - vim.cmd 'set expandtab', - vim.cmd 'set tabstop=2', - vim.cmd 'set softtabstop=2', - vim.cmd 'set shiftwidth=2', -} diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index 82bce4ed..a94eff3c 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -1,11 +1,10 @@ return { - -- Set lualine as statusline 'nvim-lualine/lualine.nvim', - -- See `:help lualine.txt` + -- dependencies = { 'nvim-tree/nvim-web-devicons' }, opts = { options = { icons_enabled = false, - theme = 'onedark', + theme = 'auto', component_separators = '|', section_separators = '', }, diff --git a/lua/plugins/none-ls.lua b/lua/plugins/none-ls.lua index 2b40c809..a0503558 100644 --- a/lua/plugins/none-ls.lua +++ b/lua/plugins/none-ls.lua @@ -5,10 +5,12 @@ return { null_ls.setup { sources = { null_ls.builtins.formatting.stylua, + null_ls.builtins.formatting.black, + null_ls.builtins.formatting.isort, null_ls.builtins.diagnostics.eslint, null_ls.builtins.completion.spell, }, } - vim.keymap.set('n', 'cf', vim.lsp.buf.format, { desc = '[C]ode [f]ormatting' }) + vim.keymap.set('n', 'cf', vim.lsp.buf.format, { desc = '[C]ode [F]ormatting' }) end, }