From e091cb27b7d391928cc9b7a8e0c1f30e552cb836 Mon Sep 17 00:00:00 2001 From: TheSoeren Date: Tue, 17 Sep 2024 10:42:30 +0200 Subject: [PATCH] updated neo-tree --- lua/custom/plugins/comment.lua | 38 +++++++++++++++++++++++++++++- lua/custom/plugins/ts-comment.lua | 1 + lua/kickstart/plugins/debug.lua | 4 ---- lua/kickstart/plugins/neo-tree.lua | 16 +++++++------ lua/plugins.lua | 10 +++++--- lua/remap.lua | 3 --- 6 files changed, 54 insertions(+), 18 deletions(-) create mode 100644 lua/custom/plugins/ts-comment.lua diff --git a/lua/custom/plugins/comment.lua b/lua/custom/plugins/comment.lua index b838291e..ae427540 100644 --- a/lua/custom/plugins/comment.lua +++ b/lua/custom/plugins/comment.lua @@ -1,2 +1,38 @@ -- "gc" to comment visual regions/lines -return { 'numToStr/Comment.nvim', opts = {} } +return { + 'numToStr/Comment.nvim', + config = function() + local prehook = require('ts_context_commentstring.integrations.comment_nvim').create_pre_hook() + require('Comment').setup { + padding = true, + sticky = true, + ignore = '^$', + toggler = { + line = 'gcc', + block = 'gbc', + }, + opleader = { + line = 'gc', + block = 'gb', + }, + extra = { + above = 'gcO', + below = 'gco', + eol = 'gcA', + }, + mappings = { + basic = true, + extra = true, + extended = false, + }, + pre_hook = prehook, + post_hook = nil, + } + end, + event = 'BufReadPre', + lazy = false, + dependencies = { + 'nvim-treesitter/nvim-treesitter', + 'JoosepAlviste/nvim-ts-context-commentstring', + }, +} diff --git a/lua/custom/plugins/ts-comment.lua b/lua/custom/plugins/ts-comment.lua new file mode 100644 index 00000000..15559d37 --- /dev/null +++ b/lua/custom/plugins/ts-comment.lua @@ -0,0 +1 @@ +return { 'JoosepAlviste/nvim-ts-context-commentstring', opts = { enable_autocmd = false } } diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 9b45e251..546ddb97 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -10,9 +10,6 @@ return { -- 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' @@ -86,7 +83,6 @@ return { 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 end, } diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua index c793b885..92c57020 100644 --- a/lua/kickstart/plugins/neo-tree.lua +++ b/lua/kickstart/plugins/neo-tree.lua @@ -3,7 +3,7 @@ return { 'nvim-neo-tree/neo-tree.nvim', - version = '*', + version = 'v3.x', dependencies = { 'nvim-lua/plenary.nvim', 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended @@ -11,15 +11,17 @@ return { }, cmd = 'Neotree', keys = { - { '\\', ':Neotree reveal', { desc = 'NeoTree reveal' } }, + { 'pv', ':Neotree reveal=true position=float', { desc = 'NeoTree reveal' } }, }, opts = { - filesystem = { - window = { - mappings = { - ['\\'] = 'close_window', - }, + window = { + mappings = { + [''] = 'close_window', }, }, + source_selector = { + winbar = true, + statusline = false, + }, }, } diff --git a/lua/plugins.lua b/lua/plugins.lua index c260f0bd..902be70d 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -15,7 +15,6 @@ require('lazy').setup({ { 'j-hui/fidget.nvim', opts = {} }, -- Useful status updates for LSP. 'williamboman/mason-lspconfig.nvim', 'WhoIsSethDaniel/mason-tool-installer.nvim', - 'nvim-java/nvim-java', -- `neodev` configures Lua LSP for your Neovim config, runtime and plugins -- used for completion, annotations and signatures of Neovim apis @@ -162,7 +161,11 @@ require('lazy').setup({ }, csharp_ls = {}, netcoredbg = {}, - clangd = {}, + clangd = { + init_options = { + fallbackFlags = { '--std=c++20' }, + }, + }, -- lua_ls = { @@ -237,6 +240,7 @@ require('lazy').setup({ } end, }, + 'nvim-java/nvim-java', { -- Autoformat 'stevearc/conform.nvim', @@ -477,7 +481,7 @@ require('lazy').setup({ -- require 'kickstart.plugins.indent_line', -- require 'kickstart.plugins.lint', -- require 'kickstart.plugins.autopairs', - -- require 'kickstart.plugins.neo-tree', + require 'kickstart.plugins.neo-tree', -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps { import = 'custom.plugins' }, diff --git a/lua/remap.lua b/lua/remap.lua index 713636a1..12fad1c9 100644 --- a/lua/remap.lua +++ b/lua/remap.lua @@ -24,9 +24,6 @@ vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' } vim.keymap.set('v', 'J', ":m '>+1gv=gv") vim.keymap.set('v', 'K', ":m '<-2gv=gv") --- Open file tree -vim.keymap.set('n', 'pv', vim.cmd.Ex) - -- Keep cursor in place when appending next line vim.keymap.set('n', 'J', 'mzJ`z')