diff --git a/README.md b/README.md index 506cfa6..c570813 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,4 @@ ## Requirements: * Git * [ripgrep](https://github.com/BurntSushi/ripgrep) +* [fd](https://github.com/sharkdp/fd) diff --git a/lua/core/init.lua b/lua/core/init.lua index ee36931..c20b77a 100644 --- a/lua/core/init.lua +++ b/lua/core/init.lua @@ -1 +1,18 @@ -require("core.settings") +local opt = vim.opt +local g = vim.g + +g.mapleader = " " + +opt.backup = false +opt.swapfile = false +opt.termguicolors = true +opt.number = true +opt.mouse = "a" +opt.cursorline = true +opt.hidden = true + +-- Indentation +opt.expandtab = true +opt.smartindent = true +opt.shiftwidth = 4 +opt.tabstop = 4 diff --git a/lua/core/settings.lua b/lua/core/settings.lua deleted file mode 100644 index c20b77a..0000000 --- a/lua/core/settings.lua +++ /dev/null @@ -1,18 +0,0 @@ -local opt = vim.opt -local g = vim.g - -g.mapleader = " " - -opt.backup = false -opt.swapfile = false -opt.termguicolors = true -opt.number = true -opt.mouse = "a" -opt.cursorline = true -opt.hidden = true - --- Indentation -opt.expandtab = true -opt.smartindent = true -opt.shiftwidth = 4 -opt.tabstop = 4 diff --git a/lua/plugins/barbar_nvimtree.lua b/lua/plugins/barbar_nvimtree.lua new file mode 100644 index 0000000..5d8510e --- /dev/null +++ b/lua/plugins/barbar_nvimtree.lua @@ -0,0 +1,10 @@ +local nvim_tree_events = require("nvim-tree.events") +local bufferline_state = require("bufferline.state") + +nvim_tree_events.on_tree_open(function () + bufferline_state.set_offset(31, "File Tree") +end) + +nvim_tree_events.on_tree_close(function () + bufferline_state.set_offset(0) +end) diff --git a/lua/plugins/config/bufdel.lua b/lua/plugins/config/bufdel.lua deleted file mode 100644 index aeb8c88..0000000 --- a/lua/plugins/config/bufdel.lua +++ /dev/null @@ -1,4 +0,0 @@ -require("bufdel").setup { - next = "alternate", - quit = false -} diff --git a/lua/plugins/config/bufferline.lua b/lua/plugins/config/bufferline.lua deleted file mode 100644 index e6f5b09..0000000 --- a/lua/plugins/config/bufferline.lua +++ /dev/null @@ -1,7 +0,0 @@ -require("bufferline").setup { - options = { - offsets = {{ filetype = "NvimTree", text = "File Explorer" }}, - tab_size = 20, - separator_style = "thin" - } -} diff --git a/lua/plugins/config/catppuccin.lua b/lua/plugins/config/catppuccin.lua new file mode 100644 index 0000000..b5dfdeb --- /dev/null +++ b/lua/plugins/config/catppuccin.lua @@ -0,0 +1,9 @@ +require("catppuccin").setup { + integrations = { + lsp_trouble = true, + which_key = true, + barbar = true + } +} + +vim.cmd[[colorscheme catppuccin]] diff --git a/lua/plugins/config/cmp.lua b/lua/plugins/config/cmp.lua deleted file mode 100644 index 993731c..0000000 --- a/lua/plugins/config/cmp.lua +++ /dev/null @@ -1,46 +0,0 @@ -local cmp = require("cmp") - -cmp.setup { - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end - }, - mapping = { - [""] = cmp.mapping.select_prev_item(), - [""] = cmp.mapping.select_next_item(), - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.close(), - [""] = cmp.mapping.confirm { - behavior = cmp.ConfirmBehavior.Replace, - select = true, - }, - [""] = function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif require("luasnip").expand_or_jumpable() then - vim.fn.feedkeys(vim.api.nvim_replace_termcodes("luasnip-expand-or-jump", true, true, true), "") - else - fallback() - end - end, - [""] = function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif require("luasnip").jumpable(-1) then - vim.fn.feedkeys(vim.api.nvim_replace_termcodes("luasnip-jump-prev", true, true, true), "") - else - fallback() - end - end - }, - sources = { - { name = "nvim_lsp" }, - { name = "luasnip" }, - { name = "buffer" }, - { name = "nvim_lua" }, - { name = "path" } - } -} diff --git a/lua/plugins/config/lualine.lua b/lua/plugins/config/lualine.lua index 707e3d6..c1c495c 100644 --- a/lua/plugins/config/lualine.lua +++ b/lua/plugins/config/lualine.lua @@ -2,9 +2,9 @@ require("lualine").setup { options = { theme = "catppuccin" }, + extensions = { "nvim-tree", - "toggleterm", - "quickfix" + "toggleterm" } } diff --git a/lua/plugins/config/luasnip.lua b/lua/plugins/config/luasnip.lua deleted file mode 100644 index a10f62b..0000000 --- a/lua/plugins/config/luasnip.lua +++ /dev/null @@ -1,8 +0,0 @@ -local luasnip = require("luasnip") - -luasnip.config.set_config { - history = true, - updateevents = "TextChanged,TextChangedI" -} - -require("luasnip/loaders/from_vscode").load() diff --git a/lua/plugins/config/nvimtree.lua b/lua/plugins/config/nvimtree.lua index 1b53293..8748a60 100644 --- a/lua/plugins/config/nvimtree.lua +++ b/lua/plugins/config/nvimtree.lua @@ -1,25 +1,24 @@ local g = vim.g -g.nvim_tree_highlight_opened_files = 1 +g.nvim_tree_git_hl = 1 g.nvim_tree_highlight_opened_files = 1 g.nvim_tree_group_empty = 1 -g.nvim_tree_root_folder_modifier = table.concat { ":t:gs?$?/..", string.rep(" ", 1000), "?:gs?^??" } +g.nvim_tree_create_in_closed_folder = 1 require("nvim-tree").setup { disable_netrw = true, - ignore_ft_on_setup = { "dashboard" }, hijack_cursor = true, update_cwd = true, + update_focused_file = { enable = true, update_cwd = true }, - git = { - ignore = false - }, + view = { hide_root_folder = true }, + renderer = { indent_markers = { enable = true diff --git a/lua/plugins/config/treesitter.lua b/lua/plugins/config/treesitter.lua index 138a2eb..9003ba3 100644 --- a/lua/plugins/config/treesitter.lua +++ b/lua/plugins/config/treesitter.lua @@ -1,19 +1,11 @@ require("nvim-treesitter.configs").setup { - ensure_installed = { - "lua", - "typescript", - "tsx", - "json", - "javascript" - }, + ensure_installed = { "lua", "bash", "cpp", "css", "go", "gomod", "html", "javascript", "json", "make", "python", "typescript" }, + highlight = { - enable = true, - use_languagetree = true - }, - matchup = { enable = true }, - context_commentstring = { + + matchup = { enable = true } } diff --git a/lua/plugins/config/whichkey.lua b/lua/plugins/config/whichkey.lua index 06edc8d..0d91948 100644 --- a/lua/plugins/config/whichkey.lua +++ b/lua/plugins/config/whichkey.lua @@ -1,35 +1,46 @@ local wk = require("which-key") wk.setup { - ignore_missing = true + ignore_missing = false } wk.register({ [""] = { - f = { - name = "Files", - f = { "Telescope find_files", "Find File" }, - g = { "Telescope live_grep", "Live Grep" } - }, + -- Barbar b = { - name = "Buffers", - b = { "Telescope buffers", "Find Buffers" }, - x = { "BufDel", "Close Buffer" } + name = "Barbar", + x = { "BufferClose", "Close Buffer" }, + n = { "BufferMoveNext", "Move Next" }, + m = { "BufferMovePrevious", "Move Previous" }, + + p = { + name = "Pinned Buffers", + p = { "BufferPin", "Pin Buffer" }, + x = { "BufferCloseAllButPinned", "Close All But Pinned" } + } }, + + -- Telescope t = { - name = "NvimTree", - t = { "NvimTreeToggle", "NvimTree Toggle" }, - f = { "NvimTreeFocus", "NvimTree Focus" } + name = "Telescope", + w = { "Telescope live_grep", "Live Grep" }, + f = { "Telescope fd", "Find Files" }, + c = { "Telescope current_buffer_fuzzy_find", "Find In Current Buffer" }, + b = { "Telescope buffers", "Buffers" }, + k = { "Telescope keymaps", "Keymaps" } + }, + + g = { + name = "Git", + b = { "Gitsigns blame_line", "Blame Line" }, + d = { "Gitsigns diffthis", "Diff" } } }, - g = { - name = "Git", - c = { "Telescope git_commits", "Git Commits" }, - s = { "Telescope git_status", "Git Status" }, - b = { "Gitsigns blame_line", "Blame Line" }, - d = { "Gitsigns diffthis", "Diff This" } - }, + -- NvimTree + [""] = { "NvimTreeToggle", "NvimTree Toggle" }, - [""] = { "BufferLineCycleNext", "Next Buffer" } + -- Barbar (switching buffers) + [""] = { "BufferNext", "Next Buffer" }, + [""] = { "BufferPrevious", "Previous Buffer" } }) diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 18d381d..6fb4085 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -6,3 +6,4 @@ if fn.empty(fn.glob(install_path)) > 0 then end require("plugins.setup") +require("plugins.barbar_nvimtree") diff --git a/lua/plugins/mappings.lua b/lua/plugins/mappings.lua deleted file mode 100644 index 7e8786a..0000000 --- a/lua/plugins/mappings.lua +++ /dev/null @@ -1,31 +0,0 @@ -local M = {} - -M.bufdel = { - closeBuffer = "x" -} - -M.bufferline = { - nextBuffer = "", - prevBuffer = "