fix config, use symlink
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
return {
|
||||
-- Color scheme
|
||||
{
|
||||
"rktjmp/lush.nvim",
|
||||
name = "lush",
|
||||
priority = 1000,
|
||||
},
|
||||
|
||||
{
|
||||
"ramojus/mellifluous.nvim",
|
||||
dependencies = {
|
||||
"lush"
|
||||
},
|
||||
config = function()
|
||||
vim.cmd("colorscheme mellifluous")
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"nvim-lua/plenary.nvim",
|
||||
name = "plenary"
|
||||
},
|
||||
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
name = "gitsigns",
|
||||
},
|
||||
|
||||
-- Comment
|
||||
{
|
||||
"numToStr/Comment.nvim",
|
||||
event = "BufRead",
|
||||
config = function()
|
||||
require("Comment").setup()
|
||||
end
|
||||
},
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
return {
|
||||
"tpope/vim-fugitive",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = {
|
||||
"gitsigns"
|
||||
},
|
||||
config = function()
|
||||
vim.keymap.set("n", "<leader>gs", vim.cmd.Git);
|
||||
|
||||
require("gitsigns").setup({
|
||||
current_line_blame = true,
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
return {
|
||||
"theprimeagen/harpoon",
|
||||
event = "BufRead",
|
||||
dependencies = {
|
||||
"plenary",
|
||||
},
|
||||
|
||||
config = function()
|
||||
local mark = require("harpoon.mark")
|
||||
local ui = require("harpoon.ui")
|
||||
|
||||
vim.keymap.set("n", "<leader>a", mark.add_file)
|
||||
vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu)
|
||||
|
||||
vim.keymap.set("n", "<C-h>", function() ui.nav_file(1) end)
|
||||
vim.keymap.set("n", "<C-t>", function() ui.nav_file(2) end)
|
||||
vim.keymap.set("n", "<C-n>", function() ui.nav_file(3) end)
|
||||
vim.keymap.set("n", "<C-s>", function() ui.nav_file(4) end)
|
||||
end
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
"hrsh7th/nvim-cmp",
|
||||
"j-hui/fidget.nvim",
|
||||
"L3MON4D3/LuaSnip",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
},
|
||||
|
||||
config = function()
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
local lspconfig = require("lspconfig")
|
||||
local configs = require("lspconfig.configs")
|
||||
|
||||
-- elixir config
|
||||
local lexical_config = {
|
||||
filetypes = { "elixir", "eelixir", "heex" },
|
||||
cmd = { "/home/mimu/.local/share/nvim/mason/packages/lexical/libexec/lexical/bin/start_lexical.sh" },
|
||||
settings = {},
|
||||
}
|
||||
|
||||
if not configs.lexical then
|
||||
configs.lexical = {
|
||||
default_config = {
|
||||
filetypes = lexical_config.filetypes,
|
||||
cmd = lexical_config.cmd,
|
||||
root_dir = function(fname)
|
||||
return lspconfig.util.root_pattern("mix.exs", ".git")(fname) or vim.loop.os_homedir()
|
||||
end,
|
||||
-- optional settings
|
||||
settings = lexical_config.settings,
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
lspconfig.lexical.setup({})
|
||||
|
||||
require("fidget").setup()
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = {
|
||||
"lua_ls",
|
||||
"rust_analyzer",
|
||||
"clangd",
|
||||
"gopls",
|
||||
"lexical",
|
||||
"tsserver",
|
||||
"intelephense",
|
||||
},
|
||||
handlers = {
|
||||
function(server_name) -- default handler (optional)
|
||||
require("lspconfig")[server_name].setup {
|
||||
capabilities = capabilities
|
||||
}
|
||||
end,
|
||||
|
||||
["intelephense"] = function()
|
||||
lspconfig.intelephense.setup {
|
||||
root_dir = function(fname)
|
||||
return lspconfig.util.find_git_ancestor(fname) or
|
||||
lspconfig.util.root_pattern("composer.json", ".git")(fname) or
|
||||
lspconfig.util.path.dirname(fname)
|
||||
end
|
||||
}
|
||||
end,
|
||||
|
||||
["gopls"] = function()
|
||||
lspconfig.gopls.setup {
|
||||
settings = {
|
||||
gopls = {
|
||||
analyses = {
|
||||
unusedparams = true,
|
||||
},
|
||||
staticcheck = true,
|
||||
gofumpt = true,
|
||||
}
|
||||
}
|
||||
}
|
||||
end,
|
||||
|
||||
["lua_ls"] = function()
|
||||
lspconfig.lua_ls.setup {
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = { "vim" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end,
|
||||
}
|
||||
})
|
||||
|
||||
local cmp = require("cmp")
|
||||
local cmp_select = { behaviour = cmp.SelectBehavior.Select }
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
-- REQUIRED - you must specify a snippet engine
|
||||
expand = function(args)
|
||||
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-p"] = cmp.mapping.select_prev_item(cmp_select),
|
||||
["<C-n"] = cmp.mapping.select_next_item(cmp_select),
|
||||
["<C-y"] = cmp.mapping.confirm({ select = true }),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||
["<C-Space"] = cmp.mapping.complete(),
|
||||
|
||||
-- Tab
|
||||
["<Tab>"] = function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
}, {
|
||||
{ name = "buffer" },
|
||||
})
|
||||
})
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = true,
|
||||
update_on_insert = true,
|
||||
float = {
|
||||
focusable = false,
|
||||
style = "minimal",
|
||||
border = "rounded",
|
||||
source = "always",
|
||||
header = "",
|
||||
prefix = "",
|
||||
},
|
||||
})
|
||||
end
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
config = function()
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
icons_enabled = false,
|
||||
theme = "onedark",
|
||||
component_separators = "|",
|
||||
section_separators = "",
|
||||
}
|
||||
});
|
||||
end
|
||||
}
|
||||
@@ -0,0 +1,243 @@
|
||||
return {
|
||||
{
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
config = function()
|
||||
-- disable netrw at the very start of your init.lua (strongly advised)
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
require("nvim-tree").setup({
|
||||
auto_reload_on_write = true,
|
||||
disable_netrw = false,
|
||||
hijack_cursor = false,
|
||||
hijack_netrw = true,
|
||||
hijack_unnamed_buffer_when_opening = false,
|
||||
sort_by = "name",
|
||||
root_dirs = {},
|
||||
prefer_startup_root = false,
|
||||
sync_root_with_cwd = false,
|
||||
reload_on_bufenter = false,
|
||||
respect_buf_cwd = true,
|
||||
on_attach = "default",
|
||||
select_prompts = false,
|
||||
view = {
|
||||
centralize_selection = false,
|
||||
cursorline = true,
|
||||
debounce_delay = 15,
|
||||
width = 30,
|
||||
side = "left",
|
||||
preserve_window_proportions = false,
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
signcolumn = "yes",
|
||||
float = {
|
||||
enable = false,
|
||||
quit_on_focus_loss = true,
|
||||
open_win_config = {
|
||||
relative = "editor",
|
||||
border = "rounded",
|
||||
width = 30,
|
||||
height = 30,
|
||||
row = 1,
|
||||
col = 1,
|
||||
},
|
||||
},
|
||||
},
|
||||
renderer = {
|
||||
add_trailing = false,
|
||||
group_empty = true,
|
||||
highlight_git = false,
|
||||
full_name = false,
|
||||
highlight_opened_files = "none",
|
||||
highlight_modified = "none",
|
||||
root_folder_label = ":~:s?$?/..?",
|
||||
indent_width = 2,
|
||||
indent_markers = {
|
||||
enable = false,
|
||||
inline_arrows = true,
|
||||
icons = {
|
||||
corner = "└",
|
||||
edge = "│",
|
||||
item = "│",
|
||||
bottom = "─",
|
||||
none = " ",
|
||||
},
|
||||
},
|
||||
icons = {
|
||||
webdev_colors = false,
|
||||
git_placement = "before",
|
||||
modified_placement = "after",
|
||||
padding = " ",
|
||||
symlink_arrow = " ➛ ",
|
||||
show = {
|
||||
file = false,
|
||||
folder = false,
|
||||
folder_arrow = false,
|
||||
git = false,
|
||||
modified = false,
|
||||
},
|
||||
glyphs = {
|
||||
default = " ",
|
||||
symlink = " ",
|
||||
bookmark = " ",
|
||||
modified = "●",
|
||||
folder = {
|
||||
arrow_closed = " ",
|
||||
arrow_open = " ",
|
||||
default = " ",
|
||||
open = " ",
|
||||
empty = " ",
|
||||
empty_open = " ",
|
||||
symlink = " ",
|
||||
symlink_open = " ",
|
||||
},
|
||||
git = {
|
||||
unstaged = "✗",
|
||||
staged = "✓",
|
||||
unmerged = "",
|
||||
renamed = "➜",
|
||||
untracked = "★",
|
||||
deleted = "",
|
||||
ignored = "◌",
|
||||
},
|
||||
},
|
||||
},
|
||||
special_files = {},
|
||||
symlink_destination = true,
|
||||
},
|
||||
hijack_directories = {
|
||||
enable = true,
|
||||
auto_open = true,
|
||||
},
|
||||
update_focused_file = {
|
||||
enable = false,
|
||||
update_root = false,
|
||||
ignore_list = {},
|
||||
},
|
||||
system_open = {
|
||||
cmd = "",
|
||||
args = {},
|
||||
},
|
||||
diagnostics = {
|
||||
enable = false,
|
||||
show_on_dirs = false,
|
||||
show_on_open_dirs = true,
|
||||
debounce_delay = 50,
|
||||
severity = {
|
||||
min = vim.diagnostic.severity.HINT,
|
||||
max = vim.diagnostic.severity.ERROR,
|
||||
},
|
||||
icons = {
|
||||
hint = "",
|
||||
info = "",
|
||||
warning = "",
|
||||
error = "",
|
||||
},
|
||||
},
|
||||
filters = {
|
||||
dotfiles = false,
|
||||
git_clean = false,
|
||||
no_buffer = false,
|
||||
custom = {},
|
||||
exclude = {},
|
||||
},
|
||||
filesystem_watchers = {
|
||||
enable = true,
|
||||
debounce_delay = 50,
|
||||
ignore_dirs = {},
|
||||
},
|
||||
git = {
|
||||
enable = false,
|
||||
ignore = true,
|
||||
show_on_dirs = true,
|
||||
show_on_open_dirs = true,
|
||||
timeout = 400,
|
||||
},
|
||||
modified = {
|
||||
enable = false,
|
||||
show_on_dirs = true,
|
||||
show_on_open_dirs = true,
|
||||
},
|
||||
actions = {
|
||||
use_system_clipboard = true,
|
||||
change_dir = {
|
||||
enable = true,
|
||||
global = false,
|
||||
restrict_above_cwd = false,
|
||||
},
|
||||
expand_all = {
|
||||
max_folder_discovery = 300,
|
||||
exclude = {},
|
||||
},
|
||||
file_popup = {
|
||||
open_win_config = {
|
||||
col = 1,
|
||||
row = 1,
|
||||
relative = "cursor",
|
||||
border = "shadow",
|
||||
style = "minimal",
|
||||
},
|
||||
},
|
||||
open_file = {
|
||||
quit_on_open = false,
|
||||
resize_window = true,
|
||||
window_picker = {
|
||||
enable = true,
|
||||
picker = "default",
|
||||
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
|
||||
exclude = {
|
||||
filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" },
|
||||
buftype = { "nofile", "terminal", "help" },
|
||||
},
|
||||
},
|
||||
},
|
||||
remove_file = {
|
||||
close_window = true,
|
||||
},
|
||||
},
|
||||
trash = {
|
||||
cmd = "gio trash",
|
||||
},
|
||||
live_filter = {
|
||||
prefix = "[FILTER]: ",
|
||||
always_show_folders = true,
|
||||
},
|
||||
tab = {
|
||||
sync = {
|
||||
open = false,
|
||||
close = false,
|
||||
ignore = {},
|
||||
},
|
||||
},
|
||||
notify = {
|
||||
threshold = vim.log.levels.INFO,
|
||||
},
|
||||
ui = {
|
||||
confirm = {
|
||||
remove = true,
|
||||
trash = true,
|
||||
},
|
||||
},
|
||||
experimental = {
|
||||
git = {
|
||||
async = true,
|
||||
},
|
||||
},
|
||||
log = {
|
||||
enable = false,
|
||||
truncate = false,
|
||||
types = {
|
||||
all = false,
|
||||
config = false,
|
||||
copy_paste = false,
|
||||
dev = false,
|
||||
diagnostics = false,
|
||||
git = false,
|
||||
profile = false,
|
||||
watcher = false,
|
||||
},
|
||||
},
|
||||
})
|
||||
end
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
dependencies = {
|
||||
"plenary"
|
||||
},
|
||||
|
||||
config = function()
|
||||
local builtin = require("telescope.builtin")
|
||||
vim.keymap.set("n", "<leader>pf", builtin.find_files, {})
|
||||
vim.keymap.set("n", "<C-p>", builtin.git_files, {})
|
||||
vim.keymap.set("n", "<leader>pb", builtin.buffers, {})
|
||||
vim.keymap.set("n", "<leader>pd", builtin.diagnostics, {})
|
||||
vim.keymap.set("n", "<leader>ps", function()
|
||||
builtin.grep_string({ search = vim.fn.input("Grep > ") })
|
||||
end)
|
||||
end
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
build = function()
|
||||
require("nvim-treesitter.install").update({ with_sync = true })
|
||||
end,
|
||||
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
-- A list of parser names, or "all" (the four listed parsers should always be installed)
|
||||
ensure_installed = { "javascript", "typescript", "c", "lua", "vim", "rust", "go" },
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||
auto_install = true,
|
||||
|
||||
highlight = {
|
||||
-- `false` will disable the whole extension
|
||||
enable = true,
|
||||
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
})
|
||||
end
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
return {
|
||||
"folke/trouble.nvim",
|
||||
config = function()
|
||||
require("trouble").setup({
|
||||
icons = false,
|
||||
fold_open = "v", -- icon used for open folds
|
||||
fold_closed = ">", -- icon used for closed folds
|
||||
indent_lines = false, -- add an indent guide below the fold icons
|
||||
signs = {
|
||||
-- icons / text used for a diagnostic
|
||||
error = "error",
|
||||
warning = "warn",
|
||||
hint = "hint",
|
||||
information = "info"
|
||||
},
|
||||
use_diagnostic_signs = false -- enabling this will use the signs defined in your lsp client
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>tt", function()
|
||||
require("trouble").toggle()
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<leader>[d", function()
|
||||
require("trouble").next({skip_groups = true, jump = true})
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<leader>]d", function()
|
||||
require("trouble").previous({skip_groups = true, jump = true})
|
||||
end)
|
||||
end
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user