fix: modify plugin directory
This commit is contained in:
@@ -150,12 +150,13 @@ local mappings = {
|
|||||||
c = { "<cmd>:nohl<cr>", "no highlight" },
|
c = { "<cmd>:nohl<cr>", "no highlight" },
|
||||||
d = { "<cmd>Telescope lsp_document_diagnostics<cr>", "Document Diagnostics" },
|
d = { "<cmd>Telescope lsp_document_diagnostics<cr>", "Document Diagnostics" },
|
||||||
D = { "<cmd>Telescope lsp_workspace_diagnostics<cr>", "Workspace Diagnostics" },
|
D = { "<cmd>Telescope lsp_workspace_diagnostics<cr>", "Workspace Diagnostics" },
|
||||||
f = { "<cmd>Fzflua files<cr>", "Find File" },
|
f = { "<cmd>Telescope find_files<CR><cr>", "Find File" },
|
||||||
m = { "<cmd>Telescope marks<cr>", "Marks" },
|
m = { "<cmd>Telescope marks<cr>", "Marks" },
|
||||||
M = { "<cmd>Telescope man_pages<cr>", "Man Pages" },
|
M = { "<cmd>Telescope man_pages<cr>", "Man Pages" },
|
||||||
-- r = { "<cmd>Telescope oldfiles <cr>", "Open Recent File" },
|
-- r = { "<cmd>Telescope oldfiles <cr>", "Open Recent File" },
|
||||||
R = { "<cmd>Telescope registers<cr>", "Registers" },
|
R = { "<cmd>Telescope registers<cr>", "Registers" },
|
||||||
t = { "<cmd>FzfLua live_grep<cr>", "Text" },
|
t = { "<cmd>Telescope live_grep<cr>", "Text" },
|
||||||
|
T = { "<cmd>Telescope live_grep<cr>", "Text" },
|
||||||
["#"] = { "<cmd>FzfLua grep_cword<cr>", "Search word under cursor" },
|
["#"] = { "<cmd>FzfLua grep_cword<cr>", "Search word under cursor" },
|
||||||
},
|
},
|
||||||
S = {
|
S = {
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ vim.o.termguicolors = true -- set term gui colors most terminals support this
|
|||||||
vim.o.splitright = true -- Vertical splits will automatically be to the right
|
vim.o.splitright = true -- Vertical splits will automatically be to the right
|
||||||
-- vim.o.t_Co = "256" -- Support 256 colors
|
-- vim.o.t_Co = "256" -- Support 256 colors
|
||||||
vim.o.conceallevel = 0 -- So that I can see `` in markdown files
|
vim.o.conceallevel = 0 -- So that I can see `` in markdown files
|
||||||
-- vim.cmd('set ts=4') -- Insert 2 spaces for a tab
|
vim.o.tabstop = 4
|
||||||
-- vim.cmd('set sw=4') -- Change the number of space characters inserted for indentation
|
vim.o.shiftwidth = 4
|
||||||
-- vim.cmd('set expandtab') -- Converts tabs to spaces
|
vim.o.expandtab = true
|
||||||
vim.bo.smartindent = true -- Makes indenting smart
|
vim.bo.smartindent = true -- Makes indenting smart
|
||||||
vim.wo.number = true -- set numbered lines
|
vim.wo.number = true -- set numbered lines
|
||||||
vim.wo.relativenumber = true -- set relative number
|
vim.wo.relativenumber = true -- set relative number
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
'romgrk/barbar.nvim',
|
||||||
|
dependencies = {
|
||||||
|
'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status
|
||||||
|
'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons
|
||||||
|
},
|
||||||
|
init = function() vim.g.barbar_auto_setup = false end,
|
||||||
|
opts = {
|
||||||
|
-- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default:
|
||||||
|
-- animation = true,
|
||||||
|
-- insert_at_start = true,
|
||||||
|
-- …etc.
|
||||||
|
},
|
||||||
|
version = '^1.0.0', -- optional: only update when a new 1.x version is released
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"stevearc/conform.nvim",
|
||||||
|
opts = {
|
||||||
|
formatters_by_ft = {
|
||||||
|
go = { "gofmt"},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,19 +1,4 @@
|
|||||||
return {
|
return {
|
||||||
{
|
|
||||||
'romgrk/barbar.nvim',
|
|
||||||
dependencies = {
|
|
||||||
'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status
|
|
||||||
'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons
|
|
||||||
},
|
|
||||||
init = function() vim.g.barbar_auto_setup = false end,
|
|
||||||
opts = {
|
|
||||||
-- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default:
|
|
||||||
-- animation = true,
|
|
||||||
-- insert_at_start = true,
|
|
||||||
-- …etc.
|
|
||||||
},
|
|
||||||
version = '^1.0.0', -- optional: only update when a new 1.x version is released
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"nvimdev/dashboard-nvim",
|
"nvimdev/dashboard-nvim",
|
||||||
event = "VimEnter",
|
event = "VimEnter",
|
||||||
@@ -1,237 +0,0 @@
|
|||||||
local function my_on_attach(bufnr)
|
|
||||||
local api = require "nvim-tree.api"
|
|
||||||
|
|
||||||
local function opts(desc)
|
|
||||||
return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
|
|
||||||
end
|
|
||||||
|
|
||||||
-- default mappings
|
|
||||||
api.config.mappings.default_on_attach(bufnr)
|
|
||||||
|
|
||||||
-- custom mappings
|
|
||||||
vim.keymap.set('n', '<C-t>', api.tree.change_root_to_parent, opts('Up'))
|
|
||||||
vim.keymap.set('n', '?', api.tree.toggle_help, opts('Help'))
|
|
||||||
vim.keymap.set('n', 'l', api.node.open.edit, opts('Edit'))
|
|
||||||
vim.keymap.set('n', 'h', api.node.navigate.parent_close, opts('Parent Close'))
|
|
||||||
vim.keymap.set('n', 's', api.node.open.horizontal, opts('Horizontal Split'))
|
|
||||||
vim.keymap.set('n', 'v', api.node.open.vertical, opts('Vertical Split'))
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.g.nvim_tree_indent_markers = 1 -- "0 by default, this option shows indent markers when folders are open
|
|
||||||
vim.g.nvim_tree_auto_ignore_ft = 'startify' --empty by default, don't auto open tree on specific filetypes.
|
|
||||||
|
|
||||||
vim.g.nvim_tree_icons = {
|
|
||||||
default = '',
|
|
||||||
symlink = '',
|
|
||||||
git = {unstaged = "", staged = "✓", unmerged = "", renamed = "➜", untracked = ""},
|
|
||||||
folder = {default = "", open = "", empty = "", empty_open = "", symlink = ""}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
|
||||||
{
|
|
||||||
'nvim-tree/nvim-tree.lua',
|
|
||||||
dependencies = {
|
|
||||||
'nvim-tree/nvim-web-devicons', -- optional
|
|
||||||
},
|
|
||||||
opts = {
|
|
||||||
on_attach = my_on_attach,
|
|
||||||
disable_netrw = true,
|
|
||||||
hijack_netrw = true,
|
|
||||||
--auto_close = false,
|
|
||||||
filters = {
|
|
||||||
dotfiles = false,
|
|
||||||
custom = {}
|
|
||||||
},
|
|
||||||
git = {
|
|
||||||
enable = true,
|
|
||||||
ignore = false,
|
|
||||||
timeout = 500,
|
|
||||||
},
|
|
||||||
update_focused_file = {
|
|
||||||
-- enables the feature
|
|
||||||
enable = true,
|
|
||||||
-- update the root directory of the tree to the one of the folder containing the file if the file is not under the current root directory
|
|
||||||
-- only relevant when `update_focused_file.enable` is true
|
|
||||||
update_cwd = false,
|
|
||||||
-- list of buffer names / filetypes that will not update the cwd if the file isn't found under the current root directory
|
|
||||||
-- only relevant when `update_focused_file.update_cwd` is true and `update_focused_file.enable` is true
|
|
||||||
ignore_list = {}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"dinhhuy258/git.nvim",
|
|
||||||
event = "BufReadPre",
|
|
||||||
opts = {
|
|
||||||
keymaps = {
|
|
||||||
-- Open blame window
|
|
||||||
blame = "<Leader>gb",
|
|
||||||
-- Open file/folder in git repository
|
|
||||||
browse = "<Leader>go",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"telescope.nvim",
|
|
||||||
dependencies = {
|
|
||||||
{
|
|
||||||
"nvim-telescope/telescope-fzf-native.nvim",
|
|
||||||
build = "make",
|
|
||||||
},
|
|
||||||
"nvim-telescope/telescope-file-browser.nvim",
|
|
||||||
},
|
|
||||||
keys = {
|
|
||||||
{
|
|
||||||
"<leader>fP",
|
|
||||||
function()
|
|
||||||
require("telescope.builtin").find_files({
|
|
||||||
cwd = require("lazy.core.config").options.root,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
desc = "Find Plugin File",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
";f",
|
|
||||||
function()
|
|
||||||
local builtin = require("telescope.builtin")
|
|
||||||
builtin.find_files({
|
|
||||||
no_ignore = false,
|
|
||||||
hidden = true,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
desc = "Lists files in your current working directory, respects .gitignore",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
";r",
|
|
||||||
function()
|
|
||||||
local builtin = require("telescope.builtin")
|
|
||||||
builtin.live_grep({
|
|
||||||
additional_args = { "--hidden" },
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
desc = "Search for a string in your current working directory and get results live as you type, respects .gitignore",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"\\\\",
|
|
||||||
function()
|
|
||||||
local builtin = require("telescope.builtin")
|
|
||||||
builtin.buffers()
|
|
||||||
end,
|
|
||||||
desc = "Lists open buffers",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
";t",
|
|
||||||
function()
|
|
||||||
local builtin = require("telescope.builtin")
|
|
||||||
builtin.help_tags()
|
|
||||||
end,
|
|
||||||
desc = "Lists available help tags and opens a new window with the relevant help info on <cr>",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
";;",
|
|
||||||
function()
|
|
||||||
local builtin = require("telescope.builtin")
|
|
||||||
builtin.resume()
|
|
||||||
end,
|
|
||||||
desc = "Resume the previous telescope picker",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
";e",
|
|
||||||
function()
|
|
||||||
local builtin = require("telescope.builtin")
|
|
||||||
builtin.diagnostics()
|
|
||||||
end,
|
|
||||||
desc = "Lists Diagnostics for all open buffers or a specific buffer",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
";s",
|
|
||||||
function()
|
|
||||||
local builtin = require("telescope.builtin")
|
|
||||||
builtin.treesitter()
|
|
||||||
end,
|
|
||||||
desc = "Lists Function names, variables, from Treesitter",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"sf",
|
|
||||||
function()
|
|
||||||
local telescope = require("telescope")
|
|
||||||
|
|
||||||
local function telescope_buffer_dir()
|
|
||||||
return vim.fn.expand("%:p:h")
|
|
||||||
end
|
|
||||||
|
|
||||||
telescope.extensions.file_browser.file_browser({
|
|
||||||
path = "%:p:h",
|
|
||||||
cwd = telescope_buffer_dir(),
|
|
||||||
respect_gitignore = false,
|
|
||||||
hidden = true,
|
|
||||||
grouped = true,
|
|
||||||
previewer = false,
|
|
||||||
initial_mode = "normal",
|
|
||||||
layout_config = { height = 40 },
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
desc = "Open File Browser with the path of the current buffer",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
config = function(_, opts)
|
|
||||||
local telescope = require("telescope")
|
|
||||||
local actions = require("telescope.actions")
|
|
||||||
local fb_actions = require("telescope").extensions.file_browser.actions
|
|
||||||
|
|
||||||
opts.defaults = vim.tbl_deep_extend("force", opts.defaults, {
|
|
||||||
wrap_results = true,
|
|
||||||
layout_strategy = "horizontal",
|
|
||||||
layout_config = { prompt_position = "top" },
|
|
||||||
sorting_strategy = "ascending",
|
|
||||||
winblend = 0,
|
|
||||||
mappings = {
|
|
||||||
n = {},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
opts.pickers = {
|
|
||||||
diagnostics = {
|
|
||||||
theme = "ivy",
|
|
||||||
initial_mode = "normal",
|
|
||||||
layout_config = {
|
|
||||||
preview_cutoff = 9999,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
opts.extensions = {
|
|
||||||
file_browser = {
|
|
||||||
theme = "dropdown",
|
|
||||||
-- disables netrw and use telescope-file-browser in its place
|
|
||||||
hijack_netrw = true,
|
|
||||||
mappings = {
|
|
||||||
-- your custom insert mode mappings
|
|
||||||
["n"] = {
|
|
||||||
-- your custom normal mode mappings
|
|
||||||
["N"] = fb_actions.create,
|
|
||||||
["h"] = fb_actions.goto_parent_dir,
|
|
||||||
["/"] = function()
|
|
||||||
vim.cmd("startinsert")
|
|
||||||
end,
|
|
||||||
["<C-u>"] = function(prompt_bufnr)
|
|
||||||
for i = 1, 10 do
|
|
||||||
actions.move_selection_previous(prompt_bufnr)
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
["<C-d>"] = function(prompt_bufnr)
|
|
||||||
for i = 1, 10 do
|
|
||||||
actions.move_selection_next(prompt_bufnr)
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
["<PageUp>"] = actions.preview_scrolling_up,
|
|
||||||
["<PageDown>"] = actions.preview_scrolling_down,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
telescope.setup(opts)
|
|
||||||
require("telescope").load_extension("fzf")
|
|
||||||
require("telescope").load_extension("file_browser")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
return {
|
|
||||||
{
|
|
||||||
"stevearc/conform.nvim",
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"dinhhuy258/git.nvim",
|
||||||
|
event = "BufReadPre",
|
||||||
|
opts = {
|
||||||
|
keymaps = {
|
||||||
|
-- Open blame window
|
||||||
|
blame = "<Leader>gb",
|
||||||
|
-- Open file/folder in git repository
|
||||||
|
browse = "<Leader>go",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"ray-x/lsp_signature.nvim",
|
||||||
|
opts = {},
|
||||||
|
config = function(_, opts) require'lsp_signature'.setup(opts) end
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
'nvimdev/lspsaga.nvim',
|
||||||
|
config = function()
|
||||||
|
require('lspsaga').setup({})
|
||||||
|
end,
|
||||||
|
dependencies = {
|
||||||
|
'nvim-treesitter/nvim-treesitter',
|
||||||
|
'nvim-tree/nvim-web-devicons' -- optional
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
opts = function(_, opts)
|
||||||
|
vim.list_extend(opts.ensure_installed, {
|
||||||
|
"stylua",
|
||||||
|
"selene",
|
||||||
|
"luacheck",
|
||||||
|
"shellcheck",
|
||||||
|
"shfmt",
|
||||||
|
"tailwindcss-language-server",
|
||||||
|
"typescript-language-server",
|
||||||
|
"css-lsp",
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -1,35 +1,4 @@
|
|||||||
return {
|
return {
|
||||||
-- tools
|
|
||||||
{
|
|
||||||
"williamboman/mason.nvim",
|
|
||||||
opts = function(_, opts)
|
|
||||||
vim.list_extend(opts.ensure_installed, {
|
|
||||||
"stylua",
|
|
||||||
"selene",
|
|
||||||
"luacheck",
|
|
||||||
"shellcheck",
|
|
||||||
"shfmt",
|
|
||||||
"tailwindcss-language-server",
|
|
||||||
"typescript-language-server",
|
|
||||||
"css-lsp",
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"ray-x/lsp_signature.nvim",
|
|
||||||
opts = {},
|
|
||||||
config = function(_, opts) require'lsp_signature'.setup(opts) end
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'nvimdev/lspsaga.nvim',
|
|
||||||
config = function()
|
|
||||||
require('lspsaga').setup({})
|
|
||||||
end,
|
|
||||||
dependencies = {
|
|
||||||
'nvim-treesitter/nvim-treesitter',
|
|
||||||
'nvim-tree/nvim-web-devicons' -- optional
|
|
||||||
}
|
|
||||||
},
|
|
||||||
-- lsp servers
|
-- lsp servers
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
local function my_on_attach(bufnr)
|
||||||
|
local api = require "nvim-tree.api"
|
||||||
|
|
||||||
|
local function opts(desc)
|
||||||
|
return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
|
||||||
|
end
|
||||||
|
|
||||||
|
-- default mappings
|
||||||
|
api.config.mappings.default_on_attach(bufnr)
|
||||||
|
|
||||||
|
-- custom mappings
|
||||||
|
vim.keymap.set('n', '<C-t>', api.tree.change_root_to_parent, opts('Up'))
|
||||||
|
vim.keymap.set('n', '?', api.tree.toggle_help, opts('Help'))
|
||||||
|
vim.keymap.set('n', 'l', api.node.open.edit, opts('Edit'))
|
||||||
|
vim.keymap.set('n', 'h', api.node.navigate.parent_close, opts('Parent Close'))
|
||||||
|
vim.keymap.set('n', 's', api.node.open.horizontal, opts('Horizontal Split'))
|
||||||
|
vim.keymap.set('n', 'v', api.node.open.vertical, opts('Vertical Split'))
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.g.nvim_tree_indent_markers = 1 -- "0 by default, this option shows indent markers when folders are open
|
||||||
|
vim.g.nvim_tree_auto_ignore_ft = 'startify' --empty by default, don't auto open tree on specific filetypes.
|
||||||
|
|
||||||
|
vim.g.nvim_tree_icons = {
|
||||||
|
default = '',
|
||||||
|
symlink = '',
|
||||||
|
git = {unstaged = "", staged = "✓", unmerged = "", renamed = "➜", untracked = ""},
|
||||||
|
folder = {default = "", open = "", empty = "", empty_open = "", symlink = ""}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
'nvim-tree/nvim-tree.lua',
|
||||||
|
dependencies = {
|
||||||
|
'nvim-tree/nvim-web-devicons', -- optional
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
on_attach = my_on_attach,
|
||||||
|
disable_netrw = true,
|
||||||
|
hijack_netrw = true,
|
||||||
|
--auto_close = false,
|
||||||
|
filters = {
|
||||||
|
dotfiles = false,
|
||||||
|
custom = {}
|
||||||
|
},
|
||||||
|
git = {
|
||||||
|
enable = true,
|
||||||
|
ignore = false,
|
||||||
|
timeout = 500,
|
||||||
|
},
|
||||||
|
update_focused_file = {
|
||||||
|
-- enables the feature
|
||||||
|
enable = true,
|
||||||
|
-- update the root directory of the tree to the one of the folder containing the file if the file is not under the current root directory
|
||||||
|
-- only relevant when `update_focused_file.enable` is true
|
||||||
|
update_cwd = false,
|
||||||
|
-- list of buffer names / filetypes that will not update the cwd if the file isn't found under the current root directory
|
||||||
|
-- only relevant when `update_focused_file.update_cwd` is true and `update_focused_file.enable` is true
|
||||||
|
ignore_list = {}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user