diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..f8b82fe --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "src/user/modules/utils/modules/neovim/config/nvim"] + path = src/user/modules/utils/modules/neovim/config/nvim + url = git@github.com:itme-brain/nvim.git diff --git a/src/user/modules/utils/modules/neovim/config/nvim b/src/user/modules/utils/modules/neovim/config/nvim new file mode 160000 index 0000000..2da1c91 --- /dev/null +++ b/src/user/modules/utils/modules/neovim/config/nvim @@ -0,0 +1 @@ +Subproject commit 2da1c91264be6bf74cd53b9bbc1d84632fc7bdbe diff --git a/src/user/modules/utils/modules/neovim/config/nvim/init.lua b/src/user/modules/utils/modules/neovim/config/nvim/init.lua deleted file mode 100644 index dd3b61d..0000000 --- a/src/user/modules/utils/modules/neovim/config/nvim/init.lua +++ /dev/null @@ -1,11 +0,0 @@ -local function load_config_directory(directory) - local config_path = vim.fn.stdpath("config") .. "/lua/" .. directory - local files = vim.fn.glob(config_path .. "/*.lua", false, true) - - for _, file in ipairs(files) do - local file_name = vim.fn.fnamemodify(file, ":t:r") -- Extract filename without extension - require(directory .. "." .. file_name) - end -end - -load_config_directory("config") diff --git a/src/user/modules/utils/modules/neovim/config/nvim/lua/config/keymaps.lua b/src/user/modules/utils/modules/neovim/config/nvim/lua/config/keymaps.lua deleted file mode 100644 index a12a224..0000000 --- a/src/user/modules/utils/modules/neovim/config/nvim/lua/config/keymaps.lua +++ /dev/null @@ -1,23 +0,0 @@ --- Keep cursor centered while navigating document -vim.keymap.set("n", "", "zz", { silent = true }) -vim.keymap.set("n", "", "zz", { silent = true }) - --- Remap Ctrl + J/K/H/L to navigate between windows -vim.keymap.set('n', '', 'j', { noremap = true, silent = true }) -vim.keymap.set('n', '', 'k', { noremap = true, silent = true }) -vim.keymap.set('n', '', 'h', { noremap = true, silent = true }) -vim.keymap.set('n', '', 'l', { noremap = true, silent = true }) - -vim.keymap.set('n', '', ':vertical resize +10', { noremap = true, silent = true }) -vim.keymap.set('n', '', ':vertical resize -10', { noremap = true, silent = true }) -vim.keymap.set('n', '', ':horizontal resize +10', { noremap = true, silent = true }) -vim.keymap.set('n', '', ':horizontal resize -10', { noremap = true, silent = true }) - --- Remap Shift + H/L to switch between buffers -vim.keymap.set('n', '', ':bprevious', { noremap = true, silent = true }) -vim.keymap.set('n', '', ':bnext', { noremap = true, silent = true }) - -vim.keymap.set("v", "<", "", ">gv") - -vim.keymap.set("n", "", ':nohlsearchlet @/=""', { noremap = true, silent = true}) diff --git a/src/user/modules/utils/modules/neovim/config/nvim/lua/config/lazy.lua b/src/user/modules/utils/modules/neovim/config/nvim/lua/config/lazy.lua deleted file mode 100644 index 89c356d..0000000 --- a/src/user/modules/utils/modules/neovim/config/nvim/lua/config/lazy.lua +++ /dev/null @@ -1,35 +0,0 @@ --- Bootstrap lazy.nvim -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not (vim.uv or vim.loop).fs_stat(lazypath) then - local lazyrepo = "https://github.com/folke/lazy.nvim.git" - local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) - if vim.v.shell_error ~= 0 then - vim.api.nvim_echo({ - { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, - { out, "WarningMsg" }, - { "\nPress any key to exit..." }, - }, true, {}) - vim.fn.getchar() - os.exit(1) - end -end -vim.opt.rtp:prepend(lazypath) - --- Make sure to setup `mapleader` and `maplocalleader` before --- loading lazy.nvim so that mappings are correct. --- This is also a good place to setup other settings (vim.opt) -vim.g.mapleader = " " -vim.g.maplocalleader = "\\" - --- Setup lazy.nvim -require("lazy").setup({ - spec = { - -- import your plugins - { import = "plugins" }, - }, - -- Configure any other settings here. See the documentation for more details. - -- colorscheme that will be used when installing plugins. - install = { colorscheme = { "onedark" } }, - -- automatically check for plugin updates - checker = { enabled = false }, -}) diff --git a/src/user/modules/utils/modules/neovim/config/nvim/lua/config/options.lua b/src/user/modules/utils/modules/neovim/config/nvim/lua/config/options.lua deleted file mode 100644 index 96163da..0000000 --- a/src/user/modules/utils/modules/neovim/config/nvim/lua/config/options.lua +++ /dev/null @@ -1,35 +0,0 @@ -vim.o.clipboard = "unnamedplus" -vim.g.autoformat = false - -vim.opt.number = true -vim.opt.relativenumber = true -vim.opt.cursorline = true --- Enable true color if terminal supports it (disabled in TTY/headless) -if vim.env.COLORTERM == "truecolor" or vim.env.COLORTERM == "24bit" then - vim.opt.termguicolors = true -end - -vim.opt.tabstop = 2 -vim.opt.shiftwidth = 2 -vim.opt.softtabstop = 2 -vim.opt.expandtab = true -vim.opt.smartindent = true -vim.opt.ignorecase = true -vim.opt.smartcase = true -vim.opt.incsearch = false - -vim.opt.swapfile = false -vim.opt.backup = false -vim.opt.undofile = true - -vim.opt.guicursor = "n-v-c:block,i:block,r:block" - -vim.opt.fillchars = { eob = " " } - -vim.cmd([[ - autocmd FileType python,haskell,c,cpp setlocal tabstop=4 shiftwidth=4 softtabstop=4 -]]) - -vim.cmd([[ - au BufRead,BufNewFile *.purs set filetype=purescript -]]) diff --git a/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/bufferline.lua b/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/bufferline.lua deleted file mode 100644 index 8ddec03..0000000 --- a/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/bufferline.lua +++ /dev/null @@ -1,40 +0,0 @@ -return { - { - "akinsho/bufferline.nvim", - version = "*", - dependencies = "nvim-tree/nvim-web-devicons", - config = function() - require("bufferline").setup{ - options = { - separator_style = "thin", - show_buffer_close_buttons = false, - show_close_icon = false, - }, - highlights = { - -- Force all icon backgrounds to transparent - buffer_selected = { bg = "NONE" }, - buffer_visible = { bg = "NONE" }, - background = { bg = "NONE" }, - fill = { bg = "NONE" }, - separator = { bg = "NONE" }, - separator_selected = { bg = "NONE" }, - separator_visible = { bg = "NONE" }, - close_button = { bg = "NONE" }, - close_button_selected = { bg = "NONE" }, - close_button_visible = { bg = "NONE" }, - modified = { bg = "NONE" }, - modified_selected = { bg = "NONE" }, - modified_visible = { bg = "NONE" }, - duplicate = { bg = "NONE" }, - duplicate_selected = { bg = "NONE" }, - duplicate_visible = { bg = "NONE" }, - indicator_selected = { bg = "NONE" }, - indicator_visible = { bg = "NONE" }, - pick = { bg = "NONE" }, - pick_selected = { bg = "NONE" }, - pick_visible = { bg = "NONE" }, - }, - } - end - } -} diff --git a/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/colorscheme.lua b/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/colorscheme.lua deleted file mode 100644 index d637c4e..0000000 --- a/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/colorscheme.lua +++ /dev/null @@ -1,77 +0,0 @@ -return { - { - "chriskempson/base16-vim", - config = function() - vim.cmd("colorscheme base16-onedark") - vim.cmd([[ - hi Normal guibg=NONE ctermbg=NONE guifg=#FFFFFF - hi Visual ctermbg=Gray ctermfg=Black guibg=Gray guifg=Black - hi NonText guibg=NONE ctermbg=NONE - hi LineNr guibg=NONE ctermbg=NONE - hi CursorLine guibg=NONE ctermbg=NONE - hi CursorLineNr guibg=NONE ctermbg=NONE guifg=#E5C07B ctermfg=Yellow cterm=bold - hi Search ctermfg=Black guifg=#000000 ctermbg=Gray guibg=#FFCC66 - hi Pmenu ctermbg=Black ctermfg=White cterm=NONE guibg=Black guifg=White gui=NONE - hi PmenuSel ctermbg=Green ctermfg=Black cterm=NONE guibg=Green guifg=Black gui=NONE - hi PmenuThumb ctermbg=Green guibg=Green - hi PmenuSbar ctermbg=Black guibg=Black - hi WinSeparator guibg=NONE ctermbg=NONE - - hi GitGutterChange guibg=NONE ctermbg=NONE - hi GitGutterAdd guibg=NONE ctermbg=NONE - hi GitGutterDelete guibg=NONE ctermbg=NONE - hi SignColumn ctermbg=NONE guibg=NONE - - hi TelescopeSelection guibg=Gray guifg=Green gui=bold ctermbg=Black ctermfg=Green cterm=bold - hi TelescopePreviewMatch ctermbg=Yellow ctermfg=Black guibg=Yellow guifg=Black - - hi TreesitterContext guibg=NONE ctermbg=NONE - - hi LazyH1 ctermbg=Green ctermfg=Black guibg=Black guifg=Green - hi IblScope guibg=NONE guifg=Yellow ctermbg=NONE ctermfg=Yellow - - hi ConflictMarker ctermfg=red guifg=red - match ConflictMarker /<<<<<<< HEAD\|=======\|>>>>>>> .\+/ - - hi DiffAdd ctermbg=none guibg=none - hi DiffChange ctermbg=none guibg=none - hi DiffDelete ctermbg=none guibg=none - hi DiffText ctermbg=none guibg=none - - " Bufferline - dark background, readable text - hi BufferLineFill guibg=NONE ctermbg=NONE - hi BufferLineBackground guibg=NONE ctermbg=NONE guifg=#5c6370 ctermfg=Gray - hi BufferLineBuffer guibg=NONE ctermbg=NONE guifg=#5c6370 ctermfg=Gray - hi BufferLineBufferSelected guibg=NONE ctermbg=NONE guifg=#FFFFFF ctermfg=White gui=bold cterm=bold - hi BufferLineBufferVisible guibg=NONE ctermbg=NONE guifg=#abb2bf ctermfg=White - hi BufferLineCloseButton guibg=NONE ctermbg=NONE guifg=#5c6370 ctermfg=Gray - hi BufferLineCloseButtonSelected guibg=NONE ctermbg=NONE guifg=#e06c75 ctermfg=Red - hi BufferLineCloseButtonVisible guibg=NONE ctermbg=NONE guifg=#5c6370 ctermfg=Gray - hi BufferLineModified guibg=NONE ctermbg=NONE guifg=#e5c07b ctermfg=Yellow - hi BufferLineModifiedSelected guibg=NONE ctermbg=NONE guifg=#e5c07b ctermfg=Yellow - hi BufferLineModifiedVisible guibg=NONE ctermbg=NONE guifg=#e5c07b ctermfg=Yellow - hi BufferLineSeparator guibg=NONE ctermbg=NONE guifg=#3e4452 ctermfg=DarkGray - hi BufferLineSeparatorSelected guibg=NONE ctermbg=NONE guifg=#3e4452 ctermfg=DarkGray - hi BufferLineSeparatorVisible guibg=NONE ctermbg=NONE guifg=#3e4452 ctermfg=DarkGray - hi BufferLineIndicatorSelected guibg=NONE ctermbg=NONE guifg=#61afef ctermfg=Blue - ]]) - - vim.api.nvim_create_autocmd("TextYankPost", { - callback = function() - vim.cmd("highlight YankHighlight ctermbg=yellow ctermfg=black guibg=yellow guifg=black") - vim.highlight.on_yank({ higroup = "YankHighlight", timeout = 150 }) - end, - }) - end, - }, - - { - "folke/todo-comments.nvim", - dependencies = { "nvim-lua/plenary.nvim" }, - }, - - { - "fei6409/log-highlight.nvim" - } - -} diff --git a/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/disabled.lua b/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/disabled.lua deleted file mode 100644 index 64e75ec..0000000 --- a/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/disabled.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - { "williamboman/mason.nvim", enabled = false }, - { "williamboman/mason-lspconfig.nvim", enabled = false }, - { "jay-babu/mason-nvim-dap.nvim", enabled = false }, -} diff --git a/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/gitsigns.lua b/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/gitsigns.lua deleted file mode 100644 index b34952f..0000000 --- a/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/gitsigns.lua +++ /dev/null @@ -1,59 +0,0 @@ -return { - { - "lewis6991/gitsigns.nvim", - config = function() - require('gitsigns').setup { - signs = { - add = { text = '+' }, - change = { text = '~' }, - delete = { text = '-' }, - topdelete = { text = '‾' }, - changedelete = { text = '~' }, - untracked = { text = '┆' }, - }, - signs_staged = { - add = { text = '+' }, - change = { text = '~' }, - delete = { text = '-' }, - topdelete = { text = '‾' }, - changedelete = { text = '~' }, - untracked = { text = '┆' }, - }, - signs_staged_enable = true, - signcolumn = false, -- Toggle with `:Gitsigns toggle_signs` - numhl = true, -- Toggle with `:Gitsigns toggle_numhl` - linehl = false, -- Toggle with `:Gitsigns toggle_linehl` - word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` - watch_gitdir = { - follow_files = true - }, - auto_attach = true, - attach_to_untracked = false, - current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` - current_line_blame_opts = { - virt_text = true, - virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' - delay = 0, - ignore_whitespace = false, - virt_text_priority = 100, - }, - current_line_blame_formatter = ', - ', - sign_priority = 6, - update_debounce = 100, - status_formatter = nil, -- Use default - max_file_length = 40000, -- Disable if file is longer than this (in lines) - preview_config = { - -- Options passed to nvim_open_win - border = 'single', - style = 'minimal', - relative = 'cursor', - row = 0, - col = 1 - }, - } - require("which-key").add({ - { "Gb", ":Gitsigns toggle_current_line_blame", desc = "Git blame" } - }) - end - } -} diff --git a/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/indent-blankline.lua b/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/indent-blankline.lua deleted file mode 100644 index 418ab88..0000000 --- a/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/indent-blankline.lua +++ /dev/null @@ -1,15 +0,0 @@ -return { - { - "lukas-reineke/indent-blankline.nvim", - config = function() - require("ibl").setup({ - --indent = { char = "│" }, - --indent = { char = "⎸" }, - indent = { char = "┆" }, - scope = { - enabled = false - }, - }) - end, - } -} diff --git a/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/lsp.lua b/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/lsp.lua deleted file mode 100644 index be26786..0000000 --- a/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/lsp.lua +++ /dev/null @@ -1,248 +0,0 @@ --- Neovim 0.11+ LSP configuration --- Uses nvim-lspconfig for server definitions + vim.lsp.enable() API - --- Detect NixOS (Mason doesn't work on NixOS due to FHS issues) -local is_nixos = vim.fn.filereadable("/etc/NIXOS") == 1 - --- Servers to ensure are installed via Mason (non-NixOS only) --- On NixOS, install these via extraPackages or per-project devShells -local mason_ensure_installed = { - "lua_ls", -- Neovim config - "nil_ls", -- Nix - "bashls", -- Shell scripts - "jsonls", -- JSON configs -} - -return { - { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - config = function() - require('nvim-treesitter.configs').setup({ - ensure_installed = { - "lua", - "c", - "cpp", - "python", - "nix", - "rust", - "bash", - "markdown", - "html", - "javascript", - "css", - - "vim", - - "git_config", - "git_rebase", - "gitattributes", - "gitcommit", - "gitignore" - }, - auto_install = true, - sync_install = true, - highlight = { - enable = true, - } - }) - end - }, - - { - "m4xshen/autoclose.nvim", - config = function() - require("autoclose").setup() - end - }, - - { - "hrsh7th/nvim-cmp", - dependencies = { - { - "L3MON4D3/LuaSnip", - version = "v2.*", - build = "make install_jsregexp", - }, - "saadparwaiz1/cmp_luasnip", - "hrsh7th/cmp-nvim-lsp" - }, - - config = function() - local cmp = require("cmp") - cmp.setup({ - enabled = function() - local context = require("cmp.config.context") - if vim.api.nvim_get_mode().mode == "c" then - return true - else - return not context.in_treesitter_capture("comment") and not context.in_syntax_group("comment") - end - end, - - snippet = { - expand = function(args) - require('luasnip').lsp_expand(args.body) - end - }, - - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.select_prev_item(), - [""] = cmp.mapping.select_next_item(), - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm(), - [""] = cmp.mapping(function(fallback) - fallback() - end, { "i", "s" }), - }), - - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = 'luasnip' }, - }, { - { name = 'buffer' } - }), - }) - end - }, - - -- Mason: portable LSP installer (disabled on NixOS where it doesn't work) - { - "williamboman/mason.nvim", - enabled = not is_nixos, - config = function() - require("mason").setup() - end - }, - { - "williamboman/mason-lspconfig.nvim", - enabled = not is_nixos, - dependencies = { "williamboman/mason.nvim" }, - config = function() - require("mason-lspconfig").setup({ - ensure_installed = mason_ensure_installed, - automatic_installation = false, -- Only install what's in ensure_installed - }) - end - }, - - { - "neovim/nvim-lspconfig", - dependencies = { - "hrsh7th/cmp-nvim-lsp", - }, - config = function() - local lspconfig = require('lspconfig') - - -- Get all known server names by scanning lspconfig's lsp directory - local function get_all_servers() - local servers = {} - local lsp_path = vim.fn.stdpath('data') .. '/lazy/nvim-lspconfig/lsp' - local files = vim.fn.globpath(lsp_path, '*.lua', false, true) - for _, file in ipairs(files) do - local server = vim.fn.fnamemodify(file, ':t:r') - table.insert(servers, server) - end - return servers - end - - local all_servers = get_all_servers() - - -- local navic = require('nvim-navic') - local capabilities = require('cmp_nvim_lsp').default_capabilities() - - -- Global config applied to all servers - vim.lsp.config('*', { - autostart = false, -- Don't auto-attach, use css to start manually - capabilities = capabilities, - -- on_attach = function(client, bufnr) - -- if client.server_capabilities.documentSymbolProvider then - -- navic.attach(client, bufnr) - -- end - -- end, - }) - - -- Server-specific settings (merged with lspconfig defaults) - vim.lsp.config.lua_ls = { - settings = { - Lua = { - diagnostics = { - globals = { 'vim' } - } - } - } - } - - -- Check if server binary is available - local function is_server_installed(config) - if config.default_config and config.default_config.cmd then - local cmd = config.default_config.cmd[1] - return vim.fn.executable(cmd) == 1 - end - return false - end - - -- Find and start LSP server(s) for current filetype - local function lsp_start_smart() - local ft = vim.bo.filetype - if ft == '' then - vim.notify("No filetype detected", vim.log.levels.WARN) - return - end - - -- Find all matching servers (filetype match + binary installed) - local matching = {} - for _, server in ipairs(all_servers) do - local ok, config = pcall(require, 'lspconfig.configs.' .. server) - if ok and config.default_config and config.default_config.filetypes then - if vim.tbl_contains(config.default_config.filetypes, ft) and is_server_installed(config) then - table.insert(matching, server) - end - end - end - - -- Sort for consistent ordering - table.sort(matching) - - local function start_server(server) - vim.lsp.enable(server) -- Register on-demand - vim.cmd('LspStart ' .. server) - end - - if #matching == 0 then - vim.notify("No LSP server installed for filetype: " .. ft, vim.log.levels.WARN) - elseif #matching == 1 then - start_server(matching[1]) - else - vim.ui.select(matching, { - prompt = "Select LSP server:", - }, function(choice) - if choice then - start_server(choice) - end - end) - end - end - - -- LSP keybindings - require("which-key").add({ - { "cs", group = "LSP Commands" }, - { "cf", function() vim.lsp.buf.format() end, desc = "Code Format" }, - { "csi", ":checkhealth vim.lsp", desc = "LSP Info" }, - { "csr", ":LspRestart", desc = "LSP Restart" }, - { "css", lsp_start_smart, desc = "LSP Start" }, - { "csx", ":LspStop", desc = "LSP Stop" }, - }) - end - }, - - { - "taproot-wizards/bitcoin-script-hints.nvim", - dependencies = { "nvim-treesitter/nvim-treesitter" }, - config = function() - require("bitcoin-script-hints").setup() - end - } -} diff --git a/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/lualine.lua b/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/lualine.lua deleted file mode 100644 index 1c09d05..0000000 --- a/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/lualine.lua +++ /dev/null @@ -1,60 +0,0 @@ -return { - { - "nvim-lualine/lualine.nvim", - dependencies = { - "nvim-tree/nvim-web-devicons", - "SmiteshP/nvim-navic" - }, - config = function() - require("lualine").setup ({ - options = { - icons_enabled = true, - theme = 'material', - component_separators = { left = '>', right = '|'}, - section_separators = { left = '', right = ''}, - disabled_filetypes = { - statusline = {}, - winbar = {}, - }, - ignore_focus = {}, - always_divide_middle = true, - globalstatus = true, - refresh = { - statusline = 1000, - tabline = 1000, - winbar = 1000, - } - }, - sections = { - lualine_a = {'mode'}, - lualine_b = {'branch', 'diff', 'diagnostics'}, - lualine_c = { - {'filename'}, - { function() return require("nvim-navic").get_location() end, cond = function() - return require("nvim-navic").is_available() - end, - }, - }, - lualine_x = {'filetype'}, - lualine_y = {'progress'}, - lualine_z = {'location'} - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = {}, - lualine_x = {}, - lualine_y = {}, - lualine_z = {} - }, - tabline = {}, - winbar = {}, - inactive_winbar = {}, - extensions = { - 'lazy', - 'neo-tree', - } - }) - end - } -} diff --git a/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/neotree.lua b/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/neotree.lua deleted file mode 100644 index de0b8d4..0000000 --- a/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/neotree.lua +++ /dev/null @@ -1,57 +0,0 @@ -return { - { - "nvim-neo-tree/neo-tree.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended - "MunifTanjim/nui.nvim", - }, - config = function() - require("neo-tree").setup({ - enable_diagnostics = false, - window = { - position = "left", - width = 20, - }, - event_handlers = { - { - event = "neo_tree_window_after_open", - handler = function() - local win = vim.api.nvim_get_current_win() - vim.wo[win].winfixwidth = true - vim.wo[win].winfixbuf = true - end - }, - }, - }) - - local function toggle_neotree() - local api = vim.api - local bufs = api.nvim_list_bufs() - - for _, buf in ipairs(bufs) do - local name = api.nvim_buf_get_name(buf) - if name:match("neo%-tree filesystem") then - api.nvim_command(":Neotree close") - return - end - end - - api.nvim_command(":Neotree") - end - - require("which-key").add({ - { "e", toggle_neotree, desc = "File Explorer" } - }) - - --vim.fn.sign_define("DiagnosticSignError", - -- {text = " ", texthl = "DiagnosticSignError"}) - --vim.fn.sign_define("DiagnosticSignWarn", - -- {text = " ", texthl = "DiagnosticSignWarn"}) - --vim.fn.sign_define("DiagnosticSignInfo", - -- {text = " ", texthl = "DiagnosticSignInfo"}) - --vim.fn.sign_define("DiagnosticSignHint", - -- {text = "󰌵", texthl = "DiagnosticSignHint"}) - end, - }, -} diff --git a/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/telescope.lua b/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/telescope.lua deleted file mode 100644 index 9bffbd4..0000000 --- a/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/telescope.lua +++ /dev/null @@ -1,57 +0,0 @@ -local function get_root() - local git_dir = vim.fn.systemlist("git rev-parse --show-toplevel")[1] - if git_dir and git_dir ~= "" then - return git_dir - else - return vim.fn.getcwd() -- Fallback to current working directory if not in a Git repo - end -end - -return { - { - "nvim-telescope/telescope.nvim", - branch = '0.1.x', - dependencies = { - { 'nvim-lua/plenary.nvim' }, - { 'nvim-tree/nvim-web-devicons' } - }, - config = function() - -- Custom Telescope command to grep from Git root - require("which-key").add({ - { "/", function() - require('telescope.builtin').live_grep({ cwd = get_root() }) - end, - desc = "grep" }, - { "/", ":Telescope live_grep", desc = "grep" }, - { "ff", ":Telescope fd", desc = "Search for Files" }, - { "fp", ":Telescope oldfiles", desc = "Oldfiles" }, - { "?", ":Telescope command_history", desc = "Command History" }, - { "cm", ":Telescope man_pages", desc = "Manpages" }, - - -- Code - { "gd", - function() - local attached = vim.lsp.get_clients({ bufnr = 0 }) - if next(attached) ~= nil then - require('telescope.builtin').lsp_definitions() - else - vim.api.nvim_command('normal! gd') - end - end, - mode = "n", - desc = "Go to Definition" - }, - { "gd", ":Telescope lsp_definitions", desc = "Go to Definition" }, - { "gr", ":Telescope lsp_references", desc = "Goto References" }, - { "gi", ":Telescope lsp_implementations", desc = "Go to Implementations" }, - { "gt", ":Telescope lsp_type_definitions", desc = "Go to Type Definition" }, - { "cv", ":Telescope treesitter", desc = "Function Names & Variables" }, - { "cd", ":Telescope diagnostics", desc = "Code Diagnostics" }, - - -- Git - { "Gt", ":Telescope git_branches", desc = "Git Branches" }, - { "Gc", ":Telescope git_commits", desc = "Git Commits" }, - }) - end - } -} diff --git a/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/which-key.lua b/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/which-key.lua deleted file mode 100644 index c3ce10d..0000000 --- a/src/user/modules/utils/modules/neovim/config/nvim/lua/plugins/which-key.lua +++ /dev/null @@ -1,39 +0,0 @@ -return { - { - "folke/which-key.nvim", - event = "VeryLazy", - opts = { - spec = { - { "l", ":Lazy", desc = "Lazy" }, - { "t", - function() - vim.cmd("botright new | setlocal nonumber norelativenumber | resize 10 | terminal") - vim.cmd("startinsert") - end, - mode = "n", - desc = "Open Terminal" - }, - - --{ "wd", "execute 'bd' | execute 'close'", desc = "Delete window & buffer" }, - -- Window & Buffer Management - { "w", group = "Windows"}, - { "wc", ":close", desc = "Close Window" }, - { "ws", ":split", desc = "Horizontal Window Split" }, - { "wv", ":vsplit", desc = "Vertial Window Split" }, - { "wm", "_", desc = "Maximize Window" }, - - { "b", group = "Buffers"}, - { "bd", ":bd", desc = "Delete Buffer" }, - { "bD", "execute 'close' | execute 'bd!'", desc = "Delete Window & Buffer" }, - - { "ca", vim.lsp.buf.code_action, desc = "Code Action" }, - { "cr", vim.lsp.buf.rename, desc = "Rename Variable" }, - - { "G", group = "Git"}, - { "f", group = "Files"}, - { "c", group = "Code"}, - { "g", group = "Goto"}, - }, - }, - } -}