Compare commits
No commits in common. "scratch" and "lazy" have entirely different histories.
32 changed files with 551 additions and 346 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +0,0 @@
|
||||||
plugin/packer_compiled.lua
|
|
24
LICENSE
24
LICENSE
|
@ -1,24 +0,0 @@
|
||||||
This is free and unencumbered software released into the public domain.
|
|
||||||
|
|
||||||
Anyone is free to copy, modify, publish, use, compile, sell, or
|
|
||||||
distribute this software, either in source code form or as a compiled
|
|
||||||
binary, for any purpose, commercial or non-commercial, and by any
|
|
||||||
means.
|
|
||||||
|
|
||||||
In jurisdictions that recognize copyright laws, the author or authors
|
|
||||||
of this software dedicate any and all copyright interest in the
|
|
||||||
software to the public domain. We make this dedication for the benefit
|
|
||||||
of the public at large and to the detriment of our heirs and
|
|
||||||
successors. We intend this dedication to be an overt act of
|
|
||||||
relinquishment in perpetuity of all present and future rights to this
|
|
||||||
software under copyright law.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
||||||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
||||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
||||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
||||||
OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
For more information, please refer to <https://unlicense.org>
|
|
|
@ -1,17 +0,0 @@
|
||||||
vim.opt.termguicolors = true
|
|
||||||
require("bufferline").setup({
|
|
||||||
options = {
|
|
||||||
diagnostics = "nvim_lsp",
|
|
||||||
themable = false,
|
|
||||||
offsets = {
|
|
||||||
{
|
|
||||||
filetype = "neo-tree",
|
|
||||||
text = "File Tree",
|
|
||||||
separator = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
separator_style = "slant",
|
|
||||||
show_buffer_close_icons = false,
|
|
||||||
show_close_icon = false,
|
|
||||||
},
|
|
||||||
})
|
|
|
@ -1,37 +0,0 @@
|
||||||
require("cmp_git").setup()
|
|
||||||
local cmp = require("cmp")
|
|
||||||
|
|
||||||
cmp.setup({
|
|
||||||
mapping = {
|
|
||||||
["<C-k>"] = cmp.mapping.select_prev_item(),
|
|
||||||
["<C-j>"] = cmp.mapping.select_next_item(),
|
|
||||||
["<C-space>"] = cmp.mapping.complete(),
|
|
||||||
["<C-q>"] = cmp.mapping.close(),
|
|
||||||
["<Tab>"] = cmp.mapping.confirm({ select = true }),
|
|
||||||
},
|
|
||||||
snippet = {
|
|
||||||
expand = function(args)
|
|
||||||
require("luasnip").lsp_expand(args.body)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = "nvim_lsp" },
|
|
||||||
{ name = "nvim_lsp_signature_help" },
|
|
||||||
{ name = "luasnip" },
|
|
||||||
}, {
|
|
||||||
{ name = "buffer" },
|
|
||||||
}),
|
|
||||||
formatting = {
|
|
||||||
format = require("lspkind").cmp_format({
|
|
||||||
mode = "symbol_text",
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
cmp.setup.filetype("gitcommit", {
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = "git" },
|
|
||||||
}, {
|
|
||||||
{ name = "buffer" },
|
|
||||||
}),
|
|
||||||
})
|
|
|
@ -1,3 +0,0 @@
|
||||||
require("ibl").setup({
|
|
||||||
scope = { enabled = true },
|
|
||||||
})
|
|
|
@ -1,100 +0,0 @@
|
||||||
require("lspkind").init({
|
|
||||||
mode = "symbol_text",
|
|
||||||
})
|
|
||||||
|
|
||||||
require("lsp_lines").setup()
|
|
||||||
vim.diagnostic.config({
|
|
||||||
virtual_text = false,
|
|
||||||
})
|
|
||||||
|
|
||||||
local vim_lsp_capabilities = vim.lsp.protocol.make_client_capabilities()
|
|
||||||
vim_lsp_capabilities.textDocument.completion.completionItem.snippetSupport = true
|
|
||||||
|
|
||||||
local lsp_capabilities = vim.tbl_deep_extend(
|
|
||||||
"force",
|
|
||||||
require("cmp_nvim_lsp").default_capabilities(),
|
|
||||||
vim_lsp_capabilities,
|
|
||||||
{ workspace = { didChangeConfiguration = { dynamicRegistration = true } } }
|
|
||||||
)
|
|
||||||
|
|
||||||
local lspconfig = require("lspconfig")
|
|
||||||
|
|
||||||
lspconfig.bashls.setup({
|
|
||||||
capabilities = lsp_capabilities,
|
|
||||||
})
|
|
||||||
|
|
||||||
lspconfig.cssls.setup({
|
|
||||||
capabilities = lsp_capabilities,
|
|
||||||
})
|
|
||||||
|
|
||||||
lspconfig.cssmodules_ls.setup({
|
|
||||||
capabilities = lsp_capabilities,
|
|
||||||
})
|
|
||||||
|
|
||||||
lspconfig.gopls.setup({
|
|
||||||
capabilities = lsp_capabilities,
|
|
||||||
})
|
|
||||||
|
|
||||||
lspconfig.jsonls.setup({
|
|
||||||
capabilities = lsp_capabilities,
|
|
||||||
})
|
|
||||||
|
|
||||||
lspconfig.lua_ls.setup({
|
|
||||||
capabilities = lsp_capabilities,
|
|
||||||
on_init = function(client)
|
|
||||||
local path = client.workspace_folders[1].name
|
|
||||||
if vim.uv.fs_stat(path .. "/.luarc.json") and not vim.uv.fs_stat(path .. "/.luarc.jsonc") then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, {
|
|
||||||
runtime = {
|
|
||||||
version = "LuaJIT",
|
|
||||||
},
|
|
||||||
workspace = {
|
|
||||||
checkThirdParty = false,
|
|
||||||
library = {
|
|
||||||
vim.env.VIMRUNTIME,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
settings = {
|
|
||||||
Lua = {},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
lspconfig.nil_ls.setup({
|
|
||||||
capabilities = lsp_capabilities,
|
|
||||||
})
|
|
||||||
|
|
||||||
lspconfig.ruby_lsp.setup({
|
|
||||||
capabilities = lsp_capabilities,
|
|
||||||
})
|
|
||||||
|
|
||||||
lspconfig.rust_analyzer.setup({
|
|
||||||
capabilities = lsp_capabilities,
|
|
||||||
})
|
|
||||||
|
|
||||||
lspconfig.volar.setup({
|
|
||||||
capabilities = lsp_capabilities,
|
|
||||||
filetypes = { "typescript", "javascript", "javascriptreact", "typescriptreact", "vue", "json" },
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.keymap.set("n", "<F2>", vim.diagnostic.goto_prev)
|
|
||||||
vim.keymap.set("n", "<F3>", vim.diagnostic.goto_next)
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("LspAttach", {
|
|
||||||
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
|
|
||||||
callback = function(ev)
|
|
||||||
vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc"
|
|
||||||
|
|
||||||
local opts = { buffer = ev.vuf }
|
|
||||||
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
|
|
||||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
|
|
||||||
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts)
|
|
||||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- refer https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
|
|
@ -1,6 +0,0 @@
|
||||||
require("lualine").setup({
|
|
||||||
options = {
|
|
||||||
globalstatus = true,
|
|
||||||
theme = "dracula-nvim",
|
|
||||||
},
|
|
||||||
})
|
|
|
@ -1 +0,0 @@
|
||||||
vim.keymap.set("n", "<leader>pp", vim.cmd.MarkdownPreviewToggle)
|
|
|
@ -1,16 +0,0 @@
|
||||||
require("neo-tree").setup({
|
|
||||||
close_if_last_window = false,
|
|
||||||
enable_diagnostics = true,
|
|
||||||
enable_git_status = true,
|
|
||||||
filesystem = {
|
|
||||||
filtered_items = {
|
|
||||||
visible = true,
|
|
||||||
},
|
|
||||||
follow_current_file = {
|
|
||||||
enabled = true,
|
|
||||||
},
|
|
||||||
use_libuv_file_watcher = true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>1", "<cmd>Neotree toggle<Return>")
|
|
|
@ -1,4 +0,0 @@
|
||||||
local builtin = require("telescope.builtin")
|
|
||||||
vim.keymap.set("n", "<leader>fg", builtin.git_files, {})
|
|
||||||
vim.keymap.set("n", "<leader>ff", builtin.find_files, {})
|
|
||||||
vim.keymap.set("n", "<leader>fp", builtin.live_grep, {})
|
|
|
@ -1,3 +0,0 @@
|
||||||
require("toggleterm").setup()
|
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>`", vim.cmd.ToggleTerm)
|
|
|
@ -1,45 +0,0 @@
|
||||||
require("nvim-treesitter.configs").setup({
|
|
||||||
|
|
||||||
ensure_installed = {
|
|
||||||
"bash",
|
|
||||||
"css",
|
|
||||||
"diff",
|
|
||||||
"dockerfile",
|
|
||||||
"git_config",
|
|
||||||
"git_rebase",
|
|
||||||
"gitattributes",
|
|
||||||
"gitcommit",
|
|
||||||
"gitignore",
|
|
||||||
"go",
|
|
||||||
"gomod",
|
|
||||||
"gosum",
|
|
||||||
"javascript",
|
|
||||||
"json",
|
|
||||||
"markdown",
|
|
||||||
"markdown_inline",
|
|
||||||
"nix",
|
|
||||||
"lua",
|
|
||||||
"toml",
|
|
||||||
"typescript",
|
|
||||||
"vim",
|
|
||||||
"vimdoc",
|
|
||||||
"vue",
|
|
||||||
"yaml",
|
|
||||||
},
|
|
||||||
|
|
||||||
sync_install = false,
|
|
||||||
auto_install = true,
|
|
||||||
|
|
||||||
highlight = {
|
|
||||||
enable = true,
|
|
||||||
additional_vim_regex_highlighting = false,
|
|
||||||
},
|
|
||||||
incremental_selection = {
|
|
||||||
enable = true,
|
|
||||||
module_path = "nvim-treesitter.incremental_selection",
|
|
||||||
},
|
|
||||||
indent = {
|
|
||||||
enable = true,
|
|
||||||
module_path = "nvim-treesitter.indent",
|
|
||||||
},
|
|
||||||
})
|
|
24
init.lua
24
init.lua
|
@ -1,3 +1,23 @@
|
||||||
require("plugins")
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
require("remaps")
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
|
vim.fn.system({
|
||||||
|
"git",
|
||||||
|
"clone",
|
||||||
|
"--filter=blob:none",
|
||||||
|
"https://github.com/folke/lazy.nvim.git",
|
||||||
|
"--branch=stable", -- latest stable release
|
||||||
|
lazypath,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
require("options")
|
require("options")
|
||||||
|
|
||||||
|
opts = {
|
||||||
|
spec = nil,
|
||||||
|
local_spec = true,
|
||||||
|
}
|
||||||
|
|
||||||
|
require("lazy").setup("plugins", opts)
|
||||||
|
|
||||||
|
require("remaps")
|
||||||
|
|
33
lazy-lock.json
Normal file
33
lazy-lock.json
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
{
|
||||||
|
"LuaSnip": { "branch": "master", "commit": "50fcf17db7c75af80e6b6109acfbfb4504768780" },
|
||||||
|
"bufferline.nvim": { "branch": "main", "commit": "99337f63f0a3c3ab9519f3d1da7618ca4f91cffe" },
|
||||||
|
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||||
|
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
||||||
|
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||||
|
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||||
|
"dashboard-nvim": { "branch": "master", "commit": "5346d023afc4bfc7ff63d05c70bcdb0784bb657a" },
|
||||||
|
"dracula.nvim": { "branch": "main", "commit": "8d8bddb8814c3e7e62d80dda65a9876f97eb699c" },
|
||||||
|
"dressing.nvim": { "branch": "master", "commit": "e3714c8049b2243e792492c4149e4cc395c68eb9" },
|
||||||
|
"fidget.nvim": { "branch": "main", "commit": "ef99df04a1c53a453602421bc0f756997edc8289" },
|
||||||
|
"friendly-snippets": { "branch": "main", "commit": "700c4a25caacbb4648c9a27972c2fe203948e0c2" },
|
||||||
|
"gitsigns.nvim": { "branch": "main", "commit": "4a143f13e122ab91abdc88f89eefbe70a4858a56" },
|
||||||
|
"indent-blankline.nvim": { "branch": "master", "commit": "d98f537c3492e87b6dc6c2e3f66ac517528f406f" },
|
||||||
|
"lazy.nvim": { "branch": "main", "commit": "eb4957442e3182f051b0ae11da32e06d22c190e3" },
|
||||||
|
"lazygit.nvim": { "branch": "main", "commit": "ad3e1ea592f9d13e86e0d4e850224d9d78069508" },
|
||||||
|
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
|
||||||
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "8db12610bcb7ce67013cfdfaba4dd47a23c6e851" },
|
||||||
|
"mason.nvim": { "branch": "main", "commit": "0950b15060067f752fde13a779a994f59516ce3d" },
|
||||||
|
"neo-tree.nvim": { "branch": "v3.x", "commit": "29f7c215332ba95e470811c380ddbce2cebe2af4" },
|
||||||
|
"noice.nvim": { "branch": "main", "commit": "6c30af2524115a399d80306bf688b72085c938b8" },
|
||||||
|
"nui.nvim": { "branch": "main", "commit": "322978c734866996274467de084a95e4f9b5e0b1" },
|
||||||
|
"nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" },
|
||||||
|
"nvim-lspconfig": { "branch": "master", "commit": "4d38bece98300e3e5cd24a9aa0d0ebfea4951c16" },
|
||||||
|
"nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" },
|
||||||
|
"nvim-treesitter": { "branch": "master", "commit": "9a7ad2ff7a7ea81016aca2fc89c9b2c1a5365421" },
|
||||||
|
"nvim-treesitter-textobjects": { "branch": "master", "commit": "34867c69838078df7d6919b130c0541c0b400c47" },
|
||||||
|
"nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" },
|
||||||
|
"persistence.nvim": { "branch": "main", "commit": "5fe077056c821aab41f87650bd6e1c48cd7dd047" },
|
||||||
|
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
|
||||||
|
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" },
|
||||||
|
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }
|
||||||
|
}
|
|
@ -16,6 +16,5 @@ vim.opt.splitbelow = true
|
||||||
vim.opt.splitright = true
|
vim.opt.splitright = true
|
||||||
vim.opt.swapfile = false
|
vim.opt.swapfile = false
|
||||||
vim.opt.tabstop = 2
|
vim.opt.tabstop = 2
|
||||||
vim.opt.termguicolors = true
|
|
||||||
vim.opt.updatetime = 100
|
vim.opt.updatetime = 100
|
||||||
vim.opt.wrap = false
|
vim.opt.wrap = false
|
||||||
|
|
|
@ -1,84 +0,0 @@
|
||||||
return require("packer").startup(function(use)
|
|
||||||
use("wbthomason/packer.nvim")
|
|
||||||
use("lewis6991/gitsigns.nvim")
|
|
||||||
use("lukas-reineke/indent-blankline.nvim")
|
|
||||||
use("mrcjkb/nvim-lastplace")
|
|
||||||
use("akinsho/toggleterm.nvim")
|
|
||||||
use("wesleimp/stylua.nvim")
|
|
||||||
use("neovim/nvim-lspconfig")
|
|
||||||
use("hrsh7th/nvim-cmp")
|
|
||||||
use("hrsh7th/cmp-nvim-lsp")
|
|
||||||
use("hrsh7th/cmp-nvim-lsp-signature-help")
|
|
||||||
use("L3MON4D3/LuaSnip")
|
|
||||||
use("saadparwaiz1/cmp_luasnip")
|
|
||||||
use("hrsh7th/cmp-buffer")
|
|
||||||
use("onsails/lspkind.nvim")
|
|
||||||
use("rafamadriz/friendly-snippets")
|
|
||||||
use("https://git.sr.ht/~whynothugo/lsp_lines.nvim")
|
|
||||||
|
|
||||||
use({
|
|
||||||
"akinsho/bufferline.nvim",
|
|
||||||
requires = {
|
|
||||||
{ "nvim-tree/nvim-web-devicons" },
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
use({
|
|
||||||
"iamcco/markdown-preview.nvim",
|
|
||||||
run = "cd app && npm install",
|
|
||||||
setup = function()
|
|
||||||
vim.g.mkdp_filetypes = { "markdown" }
|
|
||||||
end,
|
|
||||||
ft = { "markdown" },
|
|
||||||
})
|
|
||||||
|
|
||||||
use({
|
|
||||||
"kdheepak/lazygit.nvim",
|
|
||||||
requires = {
|
|
||||||
"nvim-lua/plenary.nvim",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
use({
|
|
||||||
"Mofiqul/dracula.nvim",
|
|
||||||
config = function()
|
|
||||||
vim.cmd([[colorscheme dracula]])
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
use({
|
|
||||||
"nvim-neo-tree/neo-tree.nvim",
|
|
||||||
requires = {
|
|
||||||
"nvim-lua/plenary.nvim",
|
|
||||||
"nvim-tree/nvim-web-devicons",
|
|
||||||
"MunifTanjim/nui.nvim",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
use({
|
|
||||||
"nvim-lualine/lualine.nvim",
|
|
||||||
requires = { "nvim-tree/nvim-web-devicons", opt = true },
|
|
||||||
})
|
|
||||||
|
|
||||||
use({
|
|
||||||
"nvim-telescope/telescope.nvim",
|
|
||||||
requires = "nvim-lua/plenary.nvim",
|
|
||||||
})
|
|
||||||
|
|
||||||
use({
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
{ run = ":TSUpdate" },
|
|
||||||
})
|
|
||||||
|
|
||||||
use({
|
|
||||||
"petertriho/cmp-git",
|
|
||||||
requires = "nvim-lua/plenary.nvim",
|
|
||||||
})
|
|
||||||
|
|
||||||
use({
|
|
||||||
"j-hui/fidget.nvim",
|
|
||||||
config = function()
|
|
||||||
require("fidget").setup()
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end)
|
|
36
lua/plugins/bufferline.lua
Normal file
36
lua/plugins/bufferline.lua
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
local Plugin = { "akinsho/bufferline.nvim" }
|
||||||
|
Plugin.version = "*"
|
||||||
|
Plugin.dependencies = "nvim-tree/nvim-web-devicons"
|
||||||
|
|
||||||
|
Plugin.event = "BufEnter"
|
||||||
|
|
||||||
|
function Plugin.init()
|
||||||
|
vim.opt.termguicolors = true
|
||||||
|
end
|
||||||
|
|
||||||
|
Plugin.opts = {
|
||||||
|
options = {
|
||||||
|
themable = false,
|
||||||
|
diagnostics = "nvim_lsp",
|
||||||
|
mode = "buffers",
|
||||||
|
offsets = {
|
||||||
|
{ filetype = "neo-tree", text = "File Tree", separator = true },
|
||||||
|
},
|
||||||
|
separator_style = "slant",
|
||||||
|
show_buffer_close_icons = false,
|
||||||
|
show_close_icon = false,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- :help bufferline-highlights
|
||||||
|
highlights = {
|
||||||
|
buffer_selected = {
|
||||||
|
italic = false,
|
||||||
|
},
|
||||||
|
indicator_selected = {
|
||||||
|
fg = { attribute = "fg", highlight = "Function" },
|
||||||
|
italic = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
return Plugin
|
90
lua/plugins/cmp.lua
Normal file
90
lua/plugins/cmp.lua
Normal file
|
@ -0,0 +1,90 @@
|
||||||
|
local Plugin = { "hrsh7th/nvim-cmp" }
|
||||||
|
|
||||||
|
Plugin.dependencies = {
|
||||||
|
-- Completion sources
|
||||||
|
{ "hrsh7th/cmp-buffer" },
|
||||||
|
{ "hrsh7th/cmp-path" },
|
||||||
|
{ "saadparwaiz1/cmp_luasnip" },
|
||||||
|
{ "hrsh7th/cmp-nvim-lsp" },
|
||||||
|
|
||||||
|
-- Snippets
|
||||||
|
{ "L3MON4D3/LuaSnip" },
|
||||||
|
{ "rafamadriz/friendly-snippets" },
|
||||||
|
}
|
||||||
|
|
||||||
|
Plugin.event = "InsertEnter"
|
||||||
|
|
||||||
|
function Plugin.config()
|
||||||
|
local cmp = require("cmp")
|
||||||
|
local luasnip = require("luasnip")
|
||||||
|
|
||||||
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
|
|
||||||
|
local select_opts = { behavior = cmp.SelectBehavior.Select }
|
||||||
|
|
||||||
|
-- See :help cmp-config
|
||||||
|
cmp.setup({
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
luasnip.lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
sources = {
|
||||||
|
{ name = "path" },
|
||||||
|
{ name = "nvim_lsp" },
|
||||||
|
{ name = "buffer", keyword_length = 3 },
|
||||||
|
{ name = "luasnip", keyword_length = 2 },
|
||||||
|
},
|
||||||
|
window = {
|
||||||
|
completion = cmp.config.window.bordered(),
|
||||||
|
documentation = cmp.config.window.bordered(),
|
||||||
|
},
|
||||||
|
-- See :help cmp-mapping
|
||||||
|
mapping = {
|
||||||
|
["<Up>"] = cmp.mapping.select_prev_item(select_opts),
|
||||||
|
["<Down>"] = cmp.mapping.select_next_item(select_opts),
|
||||||
|
|
||||||
|
["<C-p>"] = cmp.mapping.select_prev_item(select_opts),
|
||||||
|
["<C-n>"] = cmp.mapping.select_next_item(select_opts),
|
||||||
|
|
||||||
|
["<C-u>"] = cmp.mapping.scroll_docs(-4),
|
||||||
|
["<C-d>"] = cmp.mapping.scroll_docs(4),
|
||||||
|
|
||||||
|
["<C-e>"] = cmp.mapping.abort(),
|
||||||
|
["<C-y>"] = cmp.mapping.confirm({ select = true }),
|
||||||
|
["<CR>"] = cmp.mapping.confirm({ select = false }),
|
||||||
|
|
||||||
|
["<C-f>"] = cmp.mapping(function(fallback)
|
||||||
|
if luasnip.jumpable(1) then
|
||||||
|
luasnip.jump(1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
|
||||||
|
["<C-b>"] = cmp.mapping(function(fallback)
|
||||||
|
if luasnip.jumpable(-1) then
|
||||||
|
luasnip.jump(-1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
|
||||||
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
local col = vim.fn.col(".") - 1
|
||||||
|
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item(select_opts)
|
||||||
|
elseif col == 0 or vim.fn.getline("."):sub(col, col):match("%s") then
|
||||||
|
fallback()
|
||||||
|
else
|
||||||
|
cmp.complete()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
|
||||||
|
["<S-Tab>"] = cmp.mapping.select_prev_item(select_opts),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
return Plugin
|
16
lua/plugins/colors.lua
Normal file
16
lua/plugins/colors.lua
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
local Plugin = { "Mofiqul/dracula.nvim" }
|
||||||
|
|
||||||
|
Plugin.lazy = false
|
||||||
|
Plugin.priority = 1000
|
||||||
|
|
||||||
|
Plugin.opts = {
|
||||||
|
italic_comment = true,
|
||||||
|
show_end_of_buffer = true,
|
||||||
|
transparent_bg = true,
|
||||||
|
}
|
||||||
|
|
||||||
|
function Plugin.config()
|
||||||
|
vim.cmd([[colorscheme dracula]])
|
||||||
|
end
|
||||||
|
|
||||||
|
return Plugin
|
62
lua/plugins/dashboard.lua
Normal file
62
lua/plugins/dashboard.lua
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
local Plugin = { "nvimdev/dashboard-nvim" }
|
||||||
|
Plugin.dependencies = { { "nvim-tree/nvim-web-devicons" } }
|
||||||
|
|
||||||
|
Plugin.event = "VimEnter"
|
||||||
|
|
||||||
|
local logo = {
|
||||||
|
[[ ]],
|
||||||
|
[[ ]],
|
||||||
|
[[ ████ ██████ █████ ██ ]],
|
||||||
|
[[ ███████████ █████ ]],
|
||||||
|
[[ █████████ ███████████████████ ███ ███████████ ]],
|
||||||
|
[[ █████████ ███ █████████████ █████ ██████████████ ]],
|
||||||
|
[[ █████████ ██████████ █████████ █████ █████ ████ █████ ]],
|
||||||
|
[[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]],
|
||||||
|
[[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]],
|
||||||
|
[[ ]],
|
||||||
|
}
|
||||||
|
|
||||||
|
Plugin.opts = {
|
||||||
|
theme = "doom",
|
||||||
|
disable_move = true,
|
||||||
|
hide = {
|
||||||
|
statusline = false,
|
||||||
|
},
|
||||||
|
config = {
|
||||||
|
header = logo,
|
||||||
|
center = {
|
||||||
|
{
|
||||||
|
icon = " ",
|
||||||
|
desc = "Restore Session",
|
||||||
|
action = 'lua require("persistence").load()',
|
||||||
|
key = "r",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon = " ",
|
||||||
|
desc = "Find Text",
|
||||||
|
action = "Telescope live_grep",
|
||||||
|
key = "g",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon = " ",
|
||||||
|
desc = "Find Files",
|
||||||
|
action = "Telescope find_files",
|
||||||
|
key = "f",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon = " ",
|
||||||
|
desc = "Lazy",
|
||||||
|
action = "Lazy",
|
||||||
|
key = "l",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon = " ",
|
||||||
|
desc = "Update",
|
||||||
|
action = "Lazy update",
|
||||||
|
key = "u",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
return Plugin
|
14
lua/plugins/fidget.lua
Normal file
14
lua/plugins/fidget.lua
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
local Plugin = { "j-hui/fidget.nvim" }
|
||||||
|
|
||||||
|
Plugin.event = "VeryLazy";
|
||||||
|
|
||||||
|
Plugin.opts = {
|
||||||
|
notification = {
|
||||||
|
override_vim_notify = true,
|
||||||
|
view = {
|
||||||
|
stack_upwards = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
return Plugin
|
|
@ -1,8 +1,15 @@
|
||||||
require("gitsigns").setup({
|
local Plugin = { "lewis6991/gitsigns.nvim" }
|
||||||
|
|
||||||
|
Plugin.event = { "BufReadPost", "BufNewFile" }
|
||||||
|
|
||||||
|
-- See :help gitsigns-usage
|
||||||
|
Plugin.opts = {
|
||||||
current_line_blame = true,
|
current_line_blame = true,
|
||||||
current_line_blame_opts = {
|
current_line_blame_opts = {
|
||||||
virt_text_pos = "right_align",
|
virt_text_pos = "right_align",
|
||||||
delay = 0,
|
delay = 0,
|
||||||
},
|
},
|
||||||
current_line_blame_formatter = "<author>, <author_time:%R> - <summary>",
|
current_line_blame_formatter = "<author>, <author_time:%R> - <summary>",
|
||||||
})
|
}
|
||||||
|
|
||||||
|
return Plugin
|
14
lua/plugins/ibl.lua
Normal file
14
lua/plugins/ibl.lua
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
local Plugin = { "lukas-reineke/indent-blankline.nvim" }
|
||||||
|
|
||||||
|
Plugin.main = "ibl"
|
||||||
|
Plugin.event = { "BufReadPost", "BufNewFile" }
|
||||||
|
|
||||||
|
-- See :help ibl.setup()
|
||||||
|
Plugin.opts = {
|
||||||
|
enabled = true,
|
||||||
|
scope = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
return Plugin
|
7
lua/plugins/init.lua
Normal file
7
lua/plugins/init.lua
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
local Plugins = {
|
||||||
|
{ "stevearc/dressing.nvim", event = "VeryLazy", opts = {} },
|
||||||
|
{ "folke/persistence.nvim", event = "BufReadPre", opts = {} },
|
||||||
|
{ "nvim-tree/nvim-web-devicons", lazy = true },
|
||||||
|
}
|
||||||
|
|
||||||
|
return Plugins
|
14
lua/plugins/lazygit.lua
Normal file
14
lua/plugins/lazygit.lua
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
local Plugin = { "kdheepak/lazygit.nvim" }
|
||||||
|
Plugin.cmd = {
|
||||||
|
"LazyGit",
|
||||||
|
"LazyGitConfig",
|
||||||
|
"LazyGitCurrentFile",
|
||||||
|
"LazyGitFilter",
|
||||||
|
"LazyGitFilterCurrentFile",
|
||||||
|
}
|
||||||
|
Plugin.dependencies = { "nvim-lua/plenary.nvim" }
|
||||||
|
Plugin.keys = {
|
||||||
|
{ "<leader>lg", "<cmd>LazyGit<cr>", desc = "LazyGit" },
|
||||||
|
}
|
||||||
|
|
||||||
|
return Plugin
|
83
lua/plugins/lsp.lua
Normal file
83
lua/plugins/lsp.lua
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
local Plugin = { "neovim/nvim-lspconfig" }
|
||||||
|
Plugin.dependencies = {
|
||||||
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
|
"williamboman/mason-lspconfig.nvim",
|
||||||
|
}
|
||||||
|
|
||||||
|
local user = {}
|
||||||
|
|
||||||
|
Plugin.event = { "BufReadPre", "BufNewFile" }
|
||||||
|
Plugin.cmd = { "LspInfo", "LspInstall", "LspUnInstall" }
|
||||||
|
|
||||||
|
function Plugin.init()
|
||||||
|
-- See :help vim.diagnostic.config()
|
||||||
|
vim.diagnostic.config({
|
||||||
|
virtual_text = true,
|
||||||
|
severity_sort = true,
|
||||||
|
float = {
|
||||||
|
border = "rounded",
|
||||||
|
source = "always",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "rounded" })
|
||||||
|
|
||||||
|
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = "rounded" })
|
||||||
|
end
|
||||||
|
|
||||||
|
function Plugin.config()
|
||||||
|
local lspconfig = require("lspconfig")
|
||||||
|
local lsp_capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
|
|
||||||
|
local group = vim.api.nvim_create_augroup("lsp_cmds", { clear = true })
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
|
group = group,
|
||||||
|
desc = "LSP actions",
|
||||||
|
callback = user.on_attach,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- See :help mason-lspconfig-settings
|
||||||
|
require("mason-lspconfig").setup({
|
||||||
|
handlers = {
|
||||||
|
-- See :help mason-lspconfig-dynamic-server-setup
|
||||||
|
function(server)
|
||||||
|
-- See :help lspconfig-setup
|
||||||
|
lspconfig[server].setup({
|
||||||
|
capabilities = lsp_capabilities,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
["lua_ls"] = function()
|
||||||
|
-- if you install the language server for lua it will
|
||||||
|
-- load the config from lua/plugins/lsp/lua_ls.lua
|
||||||
|
require("plugins.lsp.lua_ls")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
function user.on_attach(event)
|
||||||
|
local bufmap = function(mode, lhs, rhs)
|
||||||
|
local opts = { buffer = event.buf }
|
||||||
|
vim.keymap.set(mode, lhs, rhs, opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- You can search each function in the help page.
|
||||||
|
-- For example :help vim.lsp.buf.hover()
|
||||||
|
|
||||||
|
bufmap("n", "K", "<cmd>lua vim.lsp.buf.hover()<cr>")
|
||||||
|
bufmap("n", "gd", "<cmd>lua vim.lsp.buf.definition()<cr>")
|
||||||
|
bufmap("n", "gD", "<cmd>lua vim.lsp.buf.declaration()<cr>")
|
||||||
|
bufmap("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<cr>")
|
||||||
|
bufmap("n", "go", "<cmd>lua vim.lsp.buf.type_definition()<cr>")
|
||||||
|
bufmap("n", "gr", "<cmd>lua vim.lsp.buf.references()<cr>")
|
||||||
|
bufmap("n", "gs", "<cmd>lua vim.lsp.buf.signature_help()<cr>")
|
||||||
|
bufmap("n", "<F2>", "<cmd>lua vim.lsp.buf.rename()<cr>")
|
||||||
|
bufmap({ "n", "x" }, "<F3>", "<cmd>lua vim.lsp.buf.format({async = true})<cr>")
|
||||||
|
bufmap("n", "<F4>", "<cmd>lua vim.lsp.buf.code_action()<cr>")
|
||||||
|
bufmap("n", "gl", "<cmd>lua vim.diagnostic.open_float()<cr>")
|
||||||
|
bufmap("n", "[d", "<cmd>lua vim.diagnostic.goto_prev()<cr>")
|
||||||
|
bufmap("n", "]d", "<cmd>lua vim.diagnostic.goto_next()<cr>")
|
||||||
|
end
|
||||||
|
|
||||||
|
return Plugin
|
24
lua/plugins/lualine.lua
Normal file
24
lua/plugins/lualine.lua
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
local Plugin = { "nvim-lualine/lualine.nvim" }
|
||||||
|
Plugin.dependencies = { "nvim-tree/nvim-web-devicons" }
|
||||||
|
|
||||||
|
Plugin.event = "VeryLazy"
|
||||||
|
|
||||||
|
function Plugin.init()
|
||||||
|
vim.opt.showmode = false
|
||||||
|
end
|
||||||
|
|
||||||
|
-- See :help lualine.txt
|
||||||
|
Plugin.opts = {
|
||||||
|
options = {
|
||||||
|
theme = "dracula-nvim",
|
||||||
|
globalstatus = true,
|
||||||
|
icons_enabled = true,
|
||||||
|
component_separators = "|",
|
||||||
|
section_separators = "",
|
||||||
|
disabled_filetypes = {
|
||||||
|
statusline = { "neo-tree" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
return Plugin
|
10
lua/plugins/mason.lua
Normal file
10
lua/plugins/mason.lua
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
local Plugin = { "williamboman/mason.nvim" }
|
||||||
|
|
||||||
|
Plugin.lazy = false
|
||||||
|
|
||||||
|
-- See :help mason-settings
|
||||||
|
Plugin.opts = {
|
||||||
|
ui = { border = "rounded" },
|
||||||
|
}
|
||||||
|
|
||||||
|
return Plugin
|
38
lua/plugins/neotree.lua
Normal file
38
lua/plugins/neotree.lua
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
local Plugin = { "nvim-neo-tree/neo-tree.nvim" }
|
||||||
|
Plugin.branch = "v3.x"
|
||||||
|
Plugin.dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"nvim-tree/nvim-web-devicons",
|
||||||
|
"MunifTanjim/nui.nvim",
|
||||||
|
}
|
||||||
|
|
||||||
|
Plugin.lazy = false
|
||||||
|
|
||||||
|
function Plugin.init()
|
||||||
|
-- disable netrw (neovim's default file explorer)
|
||||||
|
vim.g.loaded_netrw = 1
|
||||||
|
vim.g.loaded_netrwPlugin = 1
|
||||||
|
end
|
||||||
|
|
||||||
|
Plugin.opts = {
|
||||||
|
close_if_last_window = false,
|
||||||
|
enable_diagnostics = true,
|
||||||
|
enable_git_status = true,
|
||||||
|
filesystem = {
|
||||||
|
filtered_items = {
|
||||||
|
visible = true,
|
||||||
|
},
|
||||||
|
follow_current_file = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
use_libuv_file_watcher = true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
Plugin.cmd = "Neotree"
|
||||||
|
|
||||||
|
Plugin.keys = {
|
||||||
|
{ "<leader>1", "<cmd>Neotree toggle<cr>", desc = "Toggle Neotree" },
|
||||||
|
}
|
||||||
|
|
||||||
|
return Plugin
|
27
lua/plugins/telescope.lua
Normal file
27
lua/plugins/telescope.lua
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
local Plugin = { "nvim-telescope/telescope.nvim" }
|
||||||
|
Plugin.branch = "0.1.x"
|
||||||
|
|
||||||
|
Plugin.dependencies = {
|
||||||
|
{ "nvim-lua/plenary.nvim" },
|
||||||
|
{
|
||||||
|
"nvim-telescope/telescope-fzf-native.nvim",
|
||||||
|
build = "make",
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
Plugin.cmd = { "Telescope" }
|
||||||
|
|
||||||
|
Plugin.keys = {
|
||||||
|
{ "<leader><space>", "<cmd>Telescope buffers<cr>", desc = "Find buffer" },
|
||||||
|
{ "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find files" },
|
||||||
|
{ "<leader>fg", "<cmd>Telescope git_files<cr>", desc = "Find files in git" },
|
||||||
|
{ "<leader>fp", "<cmd>Telescope live_grep<cr>", desc = "Find text recursively" },
|
||||||
|
{ "<leader>fs", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Find text in current buffer" },
|
||||||
|
}
|
||||||
|
|
||||||
|
function Plugin.config()
|
||||||
|
require("telescope").load_extension("fzf")
|
||||||
|
end
|
||||||
|
|
||||||
|
return Plugin
|
49
lua/plugins/treesitter.lua
Normal file
49
lua/plugins/treesitter.lua
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
local Plugin = { "nvim-treesitter/nvim-treesitter" }
|
||||||
|
Plugin.dependencies = {
|
||||||
|
{ "nvim-treesitter/nvim-treesitter-textobjects" },
|
||||||
|
}
|
||||||
|
|
||||||
|
Plugin.main = "nvim-treesitter.configs"
|
||||||
|
|
||||||
|
-- See :help nvim-treesitter-modules
|
||||||
|
Plugin.opts = {
|
||||||
|
auto_install = true,
|
||||||
|
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
additional_vim_regex_highlighting = false,
|
||||||
|
},
|
||||||
|
incremental_selection = {
|
||||||
|
enable = true,
|
||||||
|
module_path = "nvim-treesitter.incremental_selection",
|
||||||
|
},
|
||||||
|
indent = {
|
||||||
|
enable = true,
|
||||||
|
module_path = "nvim-treesitter.indent",
|
||||||
|
},
|
||||||
|
|
||||||
|
sync_install = true,
|
||||||
|
auto_install = true,
|
||||||
|
|
||||||
|
-- :help nvim-treesitter-textobjects-modules
|
||||||
|
textobjects = {
|
||||||
|
select = {
|
||||||
|
enable = true,
|
||||||
|
lookahead = true,
|
||||||
|
keymaps = {
|
||||||
|
["af"] = "@function.outer",
|
||||||
|
["if"] = "@function.inner",
|
||||||
|
["ac"] = "@class.outer",
|
||||||
|
["ic"] = "@class.inner",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
ensure_installed = {
|
||||||
|
"vim",
|
||||||
|
"vimdoc",
|
||||||
|
"lua",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
return Plugin
|
|
@ -1,2 +1,5 @@
|
||||||
indent_type = "Spaces"
|
indent_type = "Spaces"
|
||||||
indent_width = 2
|
indent_width = 2
|
||||||
|
column_width = 120
|
||||||
|
[sort_requires]
|
||||||
|
enabled = true
|
||||||
|
|
Loading…
Reference in a new issue