Copy latest updates

This commit is contained in:
Evie Litherland-Smith 2023-05-16 09:22:33 +01:00
parent 4054030afc
commit a492f8ac95
29 changed files with 577 additions and 110 deletions

View file

@ -1,6 +1,6 @@
-- Use an on_attach function to only map the following keys -- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer -- after the language server attaches to the current buffer
local on_attach = function(_, bufnr) local on_attach = function(client, bufnr)
-- Mappings. -- Mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions -- See `:help vim.lsp.*` for documentation on any of the below functions
local bufopts = { noremap = true, silent = true, buffer = bufnr } local bufopts = { noremap = true, silent = true, buffer = bufnr }
@ -19,5 +19,9 @@ local on_attach = function(_, bufnr)
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, bufopts) vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, bufopts)
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, bufopts) vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, bufopts)
vim.keymap.set("n", "<leader>i", require "lsp.formatting", bufopts) vim.keymap.set("n", "<leader>i", require "lsp.formatting", bufopts)
if client.server_capabilities.documentSymbolProvider then
require("nvim-navic").attach(client, bufnr)
require("nvim-navbuddy").attach(client, bufnr)
end
end end
return on_attach return on_attach

58
lua/plugins/alpha.lua Normal file
View file

@ -0,0 +1,58 @@
return {
"goolord/alpha-nvim",
event = "VimEnter",
opts = function()
local dashboard = require "alpha.themes.dashboard"
local logo = [[
Z
Z
z
z
]]
dashboard.section.header.val = vim.split(logo, "\n")
dashboard.section.buttons.val = {
dashboard.button("f", "" .. " Find file", ":Telescope find_files <CR>"),
dashboard.button("e", "" .. " Edit new file", ":ene <BAR> startinsert <CR>"),
dashboard.button("r", "" .. " Recent files", ":Telescope oldfiles <CR>"),
dashboard.button("n", "󱏒 " .. " Neotree", ":Neotree left <CR>"),
dashboard.button("g", "󰊢 " .. " Git status", ":Neogit <CR>"),
dashboard.button("c", "" .. " Config", ":e $MYVIMRC <CR>"),
dashboard.button("l", "󰒲 " .. " Lazy", ":Lazy<CR>"),
dashboard.button("q", "" .. " Quit", ":qa<CR>"),
}
for _, button in ipairs(dashboard.section.buttons.val) do
button.opts.hl = "AlphaButtons"
button.opts.hl_shortcut = "AlphaShortcut"
end
dashboard.section.header.opts.hl = "AlphaHeader"
dashboard.section.buttons.opts.hl = "AlphaButtons"
dashboard.section.footer.opts.hl = "AlphaFooter"
dashboard.opts.layout[1].val = 8
return dashboard
end,
config = function(_, dashboard)
-- close Lazy and re-open when the dashboard is ready
if vim.o.filetype == "lazy" then
vim.cmd.close()
vim.api.nvim_create_autocmd("User", {
pattern = "AlphaReady",
callback = function() require("lazy").show() end,
})
end
require("alpha").setup(dashboard.opts)
vim.api.nvim_create_autocmd("User", {
pattern = "LazyVimStarted",
callback = function()
local stats = require("lazy").stats()
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
dashboard.section.footer.val = "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms"
pcall(vim.cmd.AlphaRedraw)
end,
})
end,
}

View file

@ -1,3 +1,37 @@
local config = {
flavour = "macchiato",
term_colors = true,
transparent_background = true,
integrations = {
alpha = true,
gitsigns = true,
hop = true,
indent_blankline = {
enabled = true,
colored_indent_levels = true,
},
cmp = true,
markdown = true,
mini = true,
native_lsp = {
enabled = true,
},
neogit = true,
neotree = true,
noice = true,
notify = true,
navic = {
enabled = true,
custom_bg = "NONE",
},
treesitter = true,
treesitter_context = true,
telescope = true,
lsp_trouble = true,
which_key = true,
},
}
return { return {
"catppuccin/nvim", "catppuccin/nvim",
name = "catppuccin", name = "catppuccin",
@ -8,7 +42,7 @@ return {
require "ui.fillchars" require "ui.fillchars"
end, end,
config = function() config = function()
require("catppuccin").setup(require "config.catppuccin") require("catppuccin").setup(config)
vim.cmd.colorscheme "catppuccin" vim.cmd.colorscheme "catppuccin"
end, end,
} }

7
lua/plugins/comment.lua Normal file
View file

@ -0,0 +1,7 @@
return {
"numToStr/Comment.nvim",
keys = { "gcc", "gcb" },
event = { "BufReadPre" },
config = true,
opts = { ignore = "^$" },
}

View file

@ -5,5 +5,11 @@ return {
"DiffviewFileHistory", "DiffviewFileHistory",
"DiffviewOpen", "DiffviewOpen",
}, },
config = function() require("diffview").setup(require "config.diffview") end, config = true,
opts = {
enhanced_diff_hl = true,
file_panel = {
listing_style = "list",
},
},
} }

View file

@ -1 +1 @@
return { "stevearc/dressing.nvim" } return { "stevearc/dressing.nvim", event = "VeryLazy" }

View file

@ -1,5 +1,50 @@
return { return {
"lewis6991/gitsigns.nvim", "lewis6991/gitsigns.nvim",
event = { "BufReadPre", "BufNewFile" }, event = { "BufReadPre", "BufNewFile" },
config = function() require("gitsigns").setup(require "config.gitsigns") end, config = true,
opts = {
signcolumn = true,
numhl = true,
linehl = false,
current_line_blame = true,
word_diff = false,
on_attach = function(bufnr)
local gs = package.loaded.gitsigns
local function map(mode, l, r, opts)
opts = opts or {}
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
-- Navigation
map("n", "]c", function()
if vim.wo.diff then return "]c" end
vim.schedule(function() gs.next_hunk() end)
return "<Ignore>"
end, { expr = true })
map("n", "[c", function()
if vim.wo.diff then return "[c" end
vim.schedule(function() gs.prev_hunk() end)
return "<Ignore>"
end, { expr = true })
-- Actions
map({ "n", "v" }, "<leader>hs", ":Gitsigns stage_hunk<CR>")
map({ "n", "v" }, "<leader>hr", ":Gitsigns reset_hunk<CR>")
map("n", "<leader>hS", gs.stage_buffer)
map("n", "<leader>hu", gs.undo_stage_hunk)
map("n", "<leader>hR", gs.reset_buffer)
map("n", "<leader>hp", gs.preview_hunk)
map("n", "<leader>hb", function() gs.blame_line { full = true } end)
map("n", "<leader>tb", gs.toggle_current_line_blame)
map("n", "<leader>hd", gs.diffthis)
map("n", "<leader>hD", function() gs.diffthis "~" end)
map("n", "<leader>td", gs.toggle_deleted)
-- Text object
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>")
end,
},
} }

View file

@ -1,5 +1,9 @@
return { return {
'phaazon/hop.nvim', "phaazon/hop.nvim",
cmd = {"HopWord", "HopLine"}, cmd = { "HopWord", "HopLine" },
init = function()
vim.keymap.set("n", "<leader>hw", "<cmd>HopWord<cr>")
vim.keymap.set("n", "<leader>hl", "<cmd>HopLine<cr>")
end,
config = true, config = true,
} }

View file

@ -1,5 +1,9 @@
return { return {
"lukas-reineke/indent-blankline.nvim", "lukas-reineke/indent-blankline.nvim",
event = { "BufReadPre", "BufNewFile" }, event = { "BufReadPre", "BufNewFile" },
config = function() require("indent_blankline").setup(require "config.indent_blankline") end, config = true,
opts = {
show_current_context = true,
show_current_context_start = false,
},
} }

View file

@ -1,41 +1,25 @@
return { return {
{ "neovim/nvim-lspconfig",
"neovim/nvim-lspconfig", event = { "BufReadPre", "BufNewFile", "BufEnter" },
event = { "BufReadPre", "BufNewFile" }, cmd = {
cmd = { "LspLog",
"LspLog", "LspStop",
"LspStop", "LspStart",
"LspStart", "LspRestart",
"LspRestart", "LspInfo",
"LspInfo",
},
dependencies = {
{ "hrsh7th/nvim-cmp" },
{ "rafamadriz/friendly-snippets" },
{ "windwp/nvim-autopairs" },
},
config = function()
require "lsp.config"
require "lsp.cmp"
end,
}, },
{ dependencies = {
"hrsh7th/nvim-cmp", { "hrsh7th/nvim-cmp" },
dependencies = { { "rafamadriz/friendly-snippets" },
{ "hrsh7th/cmp-nvim-lsp" }, { "windwp/nvim-autopairs" },
{ "hrsh7th/cmp-buffer" }, { "jose-elias-alvarez/null-ls.nvim", lazy = true },
{ "hrsh7th/cmp-path" }, { "mfussenegger/nvim-dap", lazy = true },
{ "hrsh7th/cmp-cmdline" }, { "folke/neodev.nvim", dependencies = { "hrsh7th/nvim-cmp" }, lazy = true },
{ "f3fora/cmp-spell" }, { "SmiteshP/nvim-navic" },
{ "petertriho/cmp-git" }, { "SmiteshP/nvim-navbuddy" },
{ "Dosx001/cmp-commit" },
{ "kdheepak/cmp-latex-symbols" },
{ "L3MON4D3/LuaSnip" },
{ "saadparwaiz1/cmp_luasnip" },
},
cmd = "CmpStatus",
}, },
{ "jose-elias-alvarez/null-ls.nvim", dependencies = { "neovim/nvim-lspconfig" }, lazy = true }, config = function()
{ "mfussenegger/nvim-dap", dependencies = { "neovim/nvim-lspconfig" }, lazy = true }, require "lsp.config"
{ "folke/neodev.nvim", dependencies = { "neovim/nvim-lspconfig", "hrsh7th/nvim-cmp" }, lazy = true }, require "lsp.cmp"
end,
} }

32
lua/plugins/lualine.lua Normal file
View file

@ -0,0 +1,32 @@
return {
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons", "SmiteshP/nvim-navic", "folke/noice.nvim" },
event = { "BufEnter" },
config = true,
opts = {
options = {
theme = "catppuccin",
component_separators = "|",
section_separators = { left = "", right = "" },
globalstatus = true,
},
sections = {
lualine_a = { "mode" },
lualine_b = { "filename", { "branch", icon = "󰊢" }, "diff" },
lualine_c = { "diagnostics", "require('noice').api.status.lsp.get_hl()" },
lualine_x = { "filetype", "fileformat", "encoding" },
lualine_y = { "progress" },
lualine_z = { "selectioncount", "location" },
},
tabline = {
lualine_a = {},
lualine_b = {},
lualine_c = { "require('nvim-navic').get_location()" },
lualine_x = { "windows" },
lualine_y = {},
lualine_z = {},
},
winbar = {},
extensions = { "aerial", "fzf", "lazy", "neo-tree", "toggleterm", "trouble" },
},
}

View file

@ -7,5 +7,12 @@ return {
"NavigatorRight", "NavigatorRight",
"NavigatorPrevious", "NavigatorPrevious",
}, },
config = function() require("Navigator").setup() end, init = function()
vim.keymap.set({ "n", "t" }, "<A-h>", "<CMD>NavigatorLeft<CR>")
vim.keymap.set({ "n", "t" }, "<A-l>", "<CMD>NavigatorRight<CR>")
vim.keymap.set({ "n", "t" }, "<A-k>", "<CMD>NavigatorUp<CR>")
vim.keymap.set({ "n", "t" }, "<A-j>", "<CMD>NavigatorDown<CR>")
vim.keymap.set({ "n", "t" }, "<A-p>", "<CMD>NavigatorPrevious<CR>")
end,
config = true,
} }

View file

@ -1,9 +1,24 @@
return { return {
"TimUntersberger/neogit", "TimUntersberger/neogit",
config = function() require("neogit").setup(require "config.neogit") end,
cmd = "Neogit",
dependencies = { dependencies = {
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
"sindrets/diffview.nvim", "sindrets/diffview.nvim",
}, },
cmd = "Neogit",
init = function()
vim.keymap.set("n", "<leader>gg", "<cmd>Neogit<CR>")
vim.keymap.set("n", "<leader>cc", "<cmd>Neogit commit<CR>")
vim.keymap.set("n", "<leader>gp", "<cmd>Neogit pull<CR>")
vim.keymap.set("n", "<leader>gP", "<cmd>Neogit push<CR>")
end,
config = true,
opts = {
disable_commit_confirmation = true,
disable_builtin_notifications = true,
-- kind = "floating",
-- commit_popup = { kind = "floating" },
-- preview_buffer = { kind = "floating" },
-- popup = { kind = "floating" },
integrations = { diffview = true },
},
} }

View file

@ -12,6 +12,37 @@ return {
vim.g.loaded_netrw = 1 vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1 vim.g.loaded_netrwPlugin = 1
vim.g.neo_tree_remove_legacy_commands = 1 vim.g.neo_tree_remove_legacy_commands = 1
vim.keymap.set("n", "<leader>nn", "<cmd>Neotree left reveal reveal_force_cwd<cr>")
vim.keymap.set("n", "<leader>nb", "<cmd>Neotree toggle show buffers right<cr>")
end, end,
config = function() require("neo-tree").setup(require "config.neotree") end, config = true,
opts = {
close_if_last_window = true,
use_popups_for_input = false,
filesystem = {
window = {
mappings = {
["Z"] = "expand_all_nodes",
["<tab>"] = "toggle_node",
},
},
filtered_items = {
hide_dotfiles = false,
},
group_empty_dirs = true,
hijack_netrw_behavior = "open_current",
},
buffers = {
bind_to_cwd = true,
follow_current_file = true,
group_empty_dirs = true,
},
git_status = {
group_empty_dirs = true,
},
source_selector = {
winbar = true,
statusline = false,
},
},
} }

44
lua/plugins/noice.lua Normal file
View file

@ -0,0 +1,44 @@
return {
"folke/noice.nvim",
dependencies = {
"MunifTanjim/nui.nvim",
"rcarriga/nvim-notify",
},
config = true,
opts = {
lsp = {
progress = {
enabled = true,
format = {
"({data.progress.percentage}%) ",
{ "{spinner} ", hl_group = "NoiceLspProgressSpinner" },
{ "{data.progress.title} ", hl_group = "NoiceLspProgressTitle" },
{ "{data.progress.client} ", hl_group = "NoiceLspProgressClient" },
},
},
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
},
views = {
mini = {
position = { row = -2 },
border = { style = "rounded" },
win_options = { winblend = 0 },
},
},
status = { lsp = { event = "lsp", kind = "progress" } },
routes = { { view = "mini", filter = { event = "lsp", kind = "progress" }, opts = { skip = true } } },
-- you can enable a preset for easier configuration
presets = {
bottom_search = false, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = false, -- long messages will be sent to a splitnoice
inc_rename = true, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = true, -- add a border to hover docs and signature help
},
},
}

View file

@ -1,7 +1,9 @@
return { return {
"rcarriga/nvim-notify", "rcarriga/nvim-notify",
config = function() config = true,
require("notify").setup(require "config.notify") opts = {
vim.notify = require "notify" background_colour = "#000000",
end, fps = 60,
render = "default", -- "minimal", "simple"
},
} }

15
lua/plugins/nvim-cmp.lua Normal file
View file

@ -0,0 +1,15 @@
return {
"hrsh7th/nvim-cmp",
dependencies = {
{ "hrsh7th/cmp-nvim-lsp" },
{ "hrsh7th/cmp-buffer" },
{ "hrsh7th/cmp-path" },
{ "hrsh7th/cmp-cmdline" },
{ "f3fora/cmp-spell" },
{ "petertriho/cmp-git" },
{ "Dosx001/cmp-commit" },
{ "kdheepak/cmp-latex-symbols" },
{ "L3MON4D3/LuaSnip" },
{ "saadparwaiz1/cmp_luasnip" },
},
}

View file

@ -5,5 +5,10 @@ return {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",
}, },
config = function() require("nvim-autopairs").setup(require "config.nvim-autopairs") end, config = true,
opts = {
disable_in_macro = true,
disable_in_visualblock = true,
check_ts = true,
},
} }

View file

@ -0,0 +1,27 @@
return {
"SmiteshP/nvim-navbuddy",
dependencies = { "SmiteshP/nvim-navic", "MunifTanjim/nui.nvim" },
cmd = { "Navbuddy" },
init = function() vim.keymap.set("n", "<leader>na", "<cmd>Navbuddy<cr>") end,
config = true,
opts = {
icons = require "ui.navic_icons",
window = {
border = "none",
size = "80%",
sections = {
left = { border = "rounded" },
mid = { border = "rounded" },
right = { border = "rounded", preview = "leaf" },
},
},
node_markers = {
enabled = true,
icons = {
leaf = " ",
leaf_selected = "",
branch = "",
},
},
},
}

View file

@ -2,5 +2,10 @@ return {
"SmiteshP/nvim-navic", "SmiteshP/nvim-navic",
dependencies = "neovim/nvim-lspconfig", dependencies = "neovim/nvim-lspconfig",
lazy = true, lazy = true,
opts = require "config.nvim-navic", config = true,
opts = {
safe_output = true,
click = true,
icons = require "ui.navic_icons",
},
} }

View file

@ -9,5 +9,20 @@ return {
"TestInfo", "TestInfo",
"TestSuite", "TestSuite",
}, },
config = function() require("nvim-test").setup(require "config.nvim_test") end, init = function()
vim.keymap.set("n", "<leader>ts", "<cmd>TestSuite<cr>")
vim.keymap.set("n", "<leader>tf", "<cmd>TestFile<cr>")
vim.keymap.set("n", "<leader>te", "<cmd>TestEdit<cr>")
vim.keymap.set("n", "<leader>tn", "<cmd>TestNearest<cr>")
vim.keymap.set("n", "<leader>tl", "<cmd>TestLast<cr>")
vim.keymap.set("n", "<leader>tv", "<cmd>TestVisit<cr>")
vim.keymap.set("n", "<leader>ti", "<cmd>TestInfo<cr>")
end,
config = true,
otps = {
termOpts = {
direction = "horizontal",
keep_one = true,
},
},
} }

View file

@ -1,5 +1,11 @@
return { return {
"ahmedkhalf/project.nvim", "ahmedkhalf/project.nvim",
event = { "BufReadPre", "BufNewFile" }, name = "project_nvim",
config = function() require("project_nvim").setup(require "config.project") end, event = { "BufEnter" },
config = true,
opts = {
ignore_lsp = { "efm", "null-ls" },
show_hidden = true,
silent_chdir = true,
},
} }

View file

@ -1,11 +1,56 @@
return { return {
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",
branch = "0.1.x", branch = "0.1.x",
dependencies = {
{
"nvim-lua/plenary.nvim",
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
{ "tsakirist/telescope-lazy.nvim", dependencies = { "folke/lazy.nvim" } },
"folke/noice.nvim",
{ "benfowler/telescope-luasnip.nvim", dependencies = { "L3MON4D3/LuaSnip" } },
{
"paopaol/telescope-git-diffs.nvim",
dependencies = { "nvim-lua/plenary.nvim", "sindrets/diffview.nvim" },
},
"FeiyouG/command_center.nvim",
{ "barrett-ruth/telescope-http.nvim", dependencies = { "savq/paq-nvim" } },
"aaronhallaert/advanced-git-search.nvim",
},
},
cmd = "Telescope", cmd = "Telescope",
init = function()
vim.keymap.set("n", "<leader>;", "<cmd>Telescope builtin<cr>")
vim.keymap.set("n", "<leader>ff", "<cmd>Telescope find_files<cr>")
vim.keymap.set("n", "<leader>fr", "<cmd>Telescope oldfiles<cr>")
vim.keymap.set("n", "<leader>fg", "<cmd>Telescope live_grep<cr>")
vim.keymap.set("n", "<leader>fb", "<cmd>Telescope buffers<cr>")
vim.keymap.set("n", "<leader>fs", "<cmd>Telescope lsp_document_symbols<cr>")
vim.keymap.set("n", "<leader>fe", "<cmd>Telescope diagnostics<cr>")
vim.keymap.set("n", "<leader>ft", "<cmd>Telescope treesitter<cr>")
vim.keymap.set("n", "<leader>fz", "<cmd>Telescope current_buffer_fuzzy_find<cr>")
end,
config = function() config = function()
require("telescope").setup(require "config.telescope") local trouble = require "trouble.providers.telescope"
require("telescope").setup {
defaults = {
layout_strategy = "flex",
mappings = {
i = { ["<c-t>"] = trouble.open_with_trouble },
n = { ["<c-t>"] = trouble.open_with_trouble },
},
winblend = vim.o.winblend,
},
extensions = {
fzf = {
fuzzy = true, -- false will only do exact matching
override_generic_sorter = true, -- override the generic sorter
override_file_sorter = true, -- override the file sorter
},
},
}
require("telescope").load_extension "fzf" require("telescope").load_extension "fzf"
require("telescope").load_extension "lazy" require("telescope").load_extension "lazy"
require("telescope").load_extension "noice"
require("telescope").load_extension "luasnip" require("telescope").load_extension "luasnip"
require("telescope").load_extension "git_diffs" require("telescope").load_extension "git_diffs"
require("telescope").load_extension "command_center" require("telescope").load_extension "command_center"
@ -13,34 +58,4 @@ return {
require("telescope").load_extension "advanced_git_search" require("telescope").load_extension "advanced_git_search"
require("telescope").load_extension "projects" require("telescope").load_extension "projects"
end, end,
dependencies = {
{
"nvim-lua/plenary.nvim",
{
"nvim-telescope/telescope-fzf-native.nvim",
build = "make",
},
{
"tsakirist/telescope-lazy.nvim",
dependencies = { "folke/lazy.nvim" },
},
{
"benfowler/telescope-luasnip.nvim",
dependencies = { "L3MON4D3/LuaSnip" },
},
{
"paopaol/telescope-git-diffs.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"sindrets/diffview.nvim",
},
},
"FeiyouG/command_center.nvim",
{
"barrett-ruth/telescope-http.nvim",
dependencies = { "savq/paq-nvim" },
},
"aaronhallaert/advanced-git-search.nvim",
},
},
} }

View file

@ -1,6 +1,7 @@
return { return {
"akinsho/toggleterm.nvim", "akinsho/toggleterm.nvim",
version = "*", version = "*",
config = true,
cmd = { "ToggleTerm" }, cmd = { "ToggleTerm" },
init = function() vim.keymap.set("n", "<leader>tt", "<cmd>ToggleTerm direction=horizontal<CR>") end,
config = true,
} }

View file

@ -1,16 +1,51 @@
return { return {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
event = { "BufReadPre", "BufNewFile" }, event = { "BufReadPre", "BufNewFile" },
cmd = { dependencies = { "nvim-treesitter/nvim-treesitter-refactor" },
"TSToggle", config = function(_, opts)
"TSBufEnable", if type(opts.ensure_installed) == "table" then
"TSBufToggle", -- @type table<string, boolean>
"TSInstall", local added = {}
"TSUpdate", opts.ensure_installed = vim.tbl_filter(function(lang)
"TSEnable", if added[lang] then return false end
}, added[lang] = true
config = function() require("nvim-treesitter.configs").setup(require "config.treesitter") end, return true
dependencies = { end, opts.ensure_installed)
"nvim-treesitter/nvim-treesitter-refactor", end
require("nvim-treesitter.configs").setup(opts)
end,
opts = {
ensure_installed = "all",
auto_install = true,
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "gnn",
node_incremental = "gnr",
scope_incremental = "gnc",
node_decremental = "gnm",
},
},
indent = {
enable = true,
},
refactor = {
smart_rename = {
enable = true,
keymaps = {
smart_rename = "grr",
},
},
navigation = {
enable = true,
keymaps = {
goto_definition_lsp_fallback = "gnd",
},
},
},
}, },
} }

View file

@ -2,5 +2,19 @@ return {
"folke/trouble.nvim", "folke/trouble.nvim",
dependencies = "nvim-tree/nvim-web-devicons", dependencies = "nvim-tree/nvim-web-devicons",
cmd = "TroubleToggle", cmd = "TroubleToggle",
config = function() require("trouble").setup(require "config.trouble") end, init = function()
vim.keymap.set("n", "<leader>xx", "<cmd>TroubleToggle<cr>")
vim.keymap.set("n", "<leader>xw", "<cmd>TroubleToggle workspace_diagnostics<cr>")
vim.keymap.set("n", "<leader>xd", "<cmd>TroubleToggle document_diagnostics<cr>")
vim.keymap.set("n", "<leader>xq", "<cmd>TroubleToggle quickfix<cr>")
vim.keymap.set("n", "<leader>xl", "<cmd>TroubleToggle loclist<cr>")
end,
config = true,
opts = {
mode = "workspace_diagnostics",
auto_open = false,
auto_close = false,
auto_preview = true,
auto_jump = { "lsp_definitions", "lsp_references", "lsp_implementations" },
},
} }

7
lua/plugins/twilight.lua Normal file
View file

@ -0,0 +1,7 @@
return {
"folke/twilight.nvim",
dependencies = { "nvim-treesitter" },
cmd = "Twilight",
config = true,
opts = { context = 10, treesitter = true },
}

View file

@ -1,13 +1,30 @@
return { return {
"folke/zen-mode.nvim", "folke/zen-mode.nvim",
cmd = "ZenMode", dependencies = { "folke/twilight.nvim" },
config = function() require("zen-mode").setup(require "config.zen_mode") end, cmd = { "ZenMode" },
dependencies = { init = function() vim.keymap.set("n", "<leader>z", "<cmd>ZenMode<CR>") end,
"folke/twilight.nvim", config = true,
cmd = "Twilight", opts = {
config = function() require("twilight").setup(require "config.twilight") end, window = {
dependencies = { options = {
"nvim-treesitter", signcolumn = "no", -- disable signcolumn
number = false, -- disable number column
relativenumber = false, -- disable relative numbers
cursorline = false, -- disable cursorline
cursorcolumn = false, -- disable cursor column
foldcolumn = "0", -- disable fold column
list = false, -- disable whitespace characters
},
}, },
plugins = {
options = {
enabled = true,
},
twilight = { enabled = true },
gitsigns = { enabled = true },
tmux = { enabled = true },
},
on_open = function(win) vim.wo.scrolloff = 999 end,
on_close = function(win) vim.wo.scrolloff = 0 end,
}, },
} }

28
lua/ui/navic_icons.lua Normal file
View file

@ -0,0 +1,28 @@
return {
File = "",
Module = "",
Namespace = "",
Package = "",
Class = "",
Method = "",
Property = "",
Field = "",
Constructor = "",
Enum = "",
Interface = "",
Function = "",
Variable = "",
Constant = "",
String = "",
Number = "",
Boolean = "",
Array = "",
Object = "",
Key = "",
Null = "",
EnumMember = "",
Struct = "",
Event = "",
Operator = "",
TypeParameter = "",
}