changed stuff
This commit is contained in:
parent
d728272259
commit
176650f0f4
2
init.lua
2
init.lua
|
@ -2,5 +2,3 @@ require "options"
|
|||
require "keymaps"
|
||||
require "Lazy"
|
||||
require "autocommands"
|
||||
|
||||
|
||||
|
|
|
@ -1,28 +1,25 @@
|
|||
{
|
||||
"Comment.nvim": { "branch": "master", "commit": "eab2c83a0207369900e92783f56990808082eac2" },
|
||||
"DAPInstall.nvim": { "branch": "main", "commit": "8798b4c36d33723e7bba6ed6e2c202f84bb300de" },
|
||||
"LuaSnip": { "branch": "master", "commit": "9bff06b570df29434a88f9c6a9cea3b21ca17208" },
|
||||
"LuaSnip": { "branch": "master", "commit": "c5fb16a934892086d4ba01bac48b77c65435025e" },
|
||||
"alpha-nvim": { "branch": "main", "commit": "dafa11a6218c2296df044e00f88d9187222ba6b0" },
|
||||
"bufdelete.nvim": { "branch": "master", "commit": "8933abc09df6c381d47dc271b1ee5d266541448e" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "c7492a76ce8218e3335f027af44930576b561013" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-cmdline": { "branch": "main", "commit": "23c51b2a3c00f6abc4e922dbd7c3b9aca6992063" },
|
||||
"bufdelete.nvim": { "branch": "master", "commit": "07d1f8ba79dec59d42b975a4df1c732b2e4e37b4" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "6ecd37e0fa8b156099daedd2191130e083fb1490" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" },
|
||||
"cmp-nvim-lua": { "branch": "main", "commit": "f3491638d123cfd2c8048aefaf66d246ff250ca6" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
|
||||
"colorbuddy.nvim": { "branch": "master", "commit": "cdb5b0654d3cafe61d2a845e15b2b4b0e78e752a" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "a6f7a1609addb4e57daa6bedc300f77f8d225ab7" },
|
||||
"coq_nvim": { "branch": "coq", "commit": "e7304683400a65e3f85e6973fcc2ad2a1bc811e6" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "ec4742a7eebf68bec663041d359b95637242b5c3" },
|
||||
"harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "9637670896b68805430e2f72cf5d16be5b97a22a" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "2a9354c7d2368d78cbd5575a51a2af5bd8a6ad01" },
|
||||
"lsp-zero.nvim": { "branch": "v2.x", "commit": "abd2208cf967b911402d32262042b71bdff06c26" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "0050b308552e45f7128f399886c86afefc3eb988" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "93e58e100f37ef4fb0f897deeed20599dae9d128" },
|
||||
"mason.nvim": { "branch": "main", "commit": "4546dec8b56bc56bc1d81e717e4a935bc7cd6477" },
|
||||
"neoscroll.nvim": { "branch": "master", "commit": "4bc0212e9f2a7bc7fe7a6bceb15b33e39f0f41fb" },
|
||||
"null-ls.nvim": { "branch": "main", "commit": "60b4a7167c79c7d04d1ff48b55f2235bf58158a7" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "0e065d423f9cf649e1d92443c939a4b5073b6768" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "cfafe0a1ca8933f7b7968a287d39904156f2c57d" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "de4f7138a68d5d5063170f2182fd27faf06b0b54" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" },
|
||||
"nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" },
|
||||
"nvim-dap": { "branch": "master", "commit": "b3d4408e29d924fe130c9397a7c3b3630b3ea671" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "1cd4764221c91686dcf4d6b62d7a7b2d112e0b13" },
|
||||
|
@ -34,10 +31,8 @@
|
|||
"nvim-web-devicons": { "branch": "master", "commit": "e283ab937e0197b37ec5d8013e49495193407324" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "9a0d3bf7b832818c042aaf30f692b081ddd58bd9" },
|
||||
"project.nvim": { "branch": "main", "commit": "685bc8e3890d2feb07ccf919522c97f7d33b94e4" },
|
||||
"pywal.nvim": { "branch": "main", "commit": "d11b673c0e3d6eb8cbee7ea8cf4a8911f6ee24b9" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "40c31fdde93bcd85aeb3447bb3e2a3208395a868" },
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "19aad0f41f47affbba1274f05e3c067e6d718e1e" },
|
||||
"tokyonight-night": { "branch": "main", "commit": "e52c41314e83232840d6970e6b072f9fba242eb9" },
|
||||
"undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" },
|
||||
"vim-illuminate": { "branch": "master", "commit": "d6ca7f77eeaf61b3e6ce9f0e5a978d606df44298" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "5224c261825263f46f6771f1b644cae33cd06995" }
|
||||
|
|
|
@ -68,6 +68,9 @@ keymap("i", "<C-Up>", "{", opts)
|
|||
keymap("i", "<C-Right>", "<C-o>E", opts)
|
||||
keymap("i", "<C-Left>", "<C-o>B", opts)
|
||||
|
||||
-- deleting back a word
|
||||
keymap("i", "<C-BS>", "<c-w>", opts)
|
||||
|
||||
-- Visual --
|
||||
-- Stay in indent mode
|
||||
keymap("v", "<", "<gv", opts)
|
||||
|
|
|
@ -1,41 +1,45 @@
|
|||
local M = {
|
||||
"goolord/alpha-nvim",
|
||||
event = "VimEnter",
|
||||
commit = "dafa11a6218c2296df044e00f88d9187222ba6b0",
|
||||
"goolord/alpha-nvim",
|
||||
event = "VimEnter",
|
||||
commit = "dafa11a6218c2296df044e00f88d9187222ba6b0",
|
||||
}
|
||||
|
||||
function M.config()
|
||||
local alpha = require "alpha"
|
||||
local dashboard = require "alpha.themes.dashboard"
|
||||
dashboard.section.header.val = {
|
||||
[[ __ ]],
|
||||
[[ ___ ___ ___ __ __ /\_\ ___ ___ ]],
|
||||
[[ / _ `\ / __`\ / __`\/\ \/\ \\/\ \ / __` __`\ ]],
|
||||
[[/\ \/\ \/\ __//\ \_\ \ \ \_/ |\ \ \/\ \/\ \/\ \ ]],
|
||||
[[\ \_\ \_\ \____\ \____/\ \___/ \ \_\ \_\ \_\ \_\]],
|
||||
[[ \/_/\/_/\/____/\/___/ \/__/ \/_/\/_/\/_/\/_/]],
|
||||
}
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button("f", " " .. " Find file", ":Telescope find_files <CR>"),
|
||||
dashboard.button("e", " " .. " New file", ":ene <BAR> startinsert <CR>"),
|
||||
dashboard.button("p", " " .. " Find project", ":lua require('telescope').extensions.projects.projects()<CR>"),
|
||||
dashboard.button("r", " " .. " Recent files", ":Telescope oldfiles <CR>"),
|
||||
dashboard.button("t", " " .. " Find text", ":Telescope live_grep <CR>"),
|
||||
dashboard.button("c", " " .. " Config", ":e $MYVIMRC <CR>"),
|
||||
dashboard.button("q", " " .. " Quit", ":qa<CR>"),
|
||||
}
|
||||
local function footer()
|
||||
return "chrisatmachine.com"
|
||||
end
|
||||
local alpha = require "alpha"
|
||||
local dashboard = require "alpha.themes.dashboard"
|
||||
dashboard.section.header.val = {
|
||||
[[ ███╗░░░███╗███████╗░█████╗░░██╗░░░░░░░██╗ ]],
|
||||
[[ ████╗░████║██╔════╝██╔══██╗░██║░░██╗░░██║ ]],
|
||||
[[ ██╔████╔██║█████╗░░██║░░██║░╚██╗████╗██╔╝ ]],
|
||||
[[ ██║╚██╔╝██║██╔══╝░░██║░░██║░░████╔═████║░ ]],
|
||||
[[ ██║░╚═╝░██║███████╗╚█████╔╝░░╚██╔╝░╚██╔╝░ ]],
|
||||
[[ ╚═╝░░░░░╚═╝╚══════╝░╚════╝░░░░╚═╝░░░╚═╝░░ ]],
|
||||
}
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button("f", " " .. " Find file", ":Telescope find_files <CR>"),
|
||||
dashboard.button("e", " " .. " New file", ":ene <BAR> startinsert <CR>"),
|
||||
dashboard.button(
|
||||
"p",
|
||||
" " .. " Find project",
|
||||
":lua require('telescope').extensions.projects.projects()<CR>"
|
||||
),
|
||||
dashboard.button("r", " " .. " Recent files", ":Telescope oldfiles <CR>"),
|
||||
dashboard.button("t", " " .. " Find text", ":Telescope live_grep <CR>"),
|
||||
dashboard.button("c", " " .. " Config", ":e $MYVIMRC <CR>"),
|
||||
dashboard.button("q", " " .. " Quit", ":qa<CR>"),
|
||||
}
|
||||
local function footer()
|
||||
return "Welcome, Lydia"
|
||||
end
|
||||
|
||||
dashboard.section.footer.val = footer()
|
||||
dashboard.section.footer.val = footer()
|
||||
|
||||
dashboard.section.footer.opts.hl = "Type"
|
||||
dashboard.section.header.opts.hl = "Include"
|
||||
dashboard.section.buttons.opts.hl = "Keyword"
|
||||
dashboard.section.footer.opts.hl = "Function"
|
||||
dashboard.section.header.opts.hl = "Boolean"
|
||||
dashboard.section.buttons.opts.hl = "Keyword"
|
||||
|
||||
dashboard.opts.opts.noautocmd = true
|
||||
alpha.setup(dashboard.opts)
|
||||
dashboard.opts.opts.noautocmd = true
|
||||
alpha.setup(dashboard.opts)
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
@ -1,44 +1,46 @@
|
|||
local M = {
|
||||
"windwp/nvim-autopairs",
|
||||
commit = "0e065d423f9cf649e1d92443c939a4b5073b6768",
|
||||
event = "InsertEnter",
|
||||
dependencies = {
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
event = {
|
||||
"InsertEnter",
|
||||
"CmdlineEnter",
|
||||
},
|
||||
},
|
||||
},
|
||||
"windwp/nvim-autopairs",
|
||||
lazy = false,
|
||||
}
|
||||
|
||||
function M.config()
|
||||
require("nvim-autopairs").setup {
|
||||
check_ts = true, -- treesitter integration
|
||||
disable_filetype = { "TelescopePrompt" },
|
||||
ts_config = {
|
||||
lua = { "string", "source" },
|
||||
javascript = { "string", "template_string" },
|
||||
java = false,
|
||||
},
|
||||
fast_wrap = {
|
||||
map = "<M-e>",
|
||||
chars = { "{", "[", "(", '"', "'" },
|
||||
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""),
|
||||
offset = 0, -- Offset from pattern match
|
||||
end_key = "$",
|
||||
keys = "qwertyuiopzxcvbnmasdfghjkl",
|
||||
check_comma = true,
|
||||
highlight = "PmenuSel",
|
||||
highlight_grey = "LineNr",
|
||||
},
|
||||
}
|
||||
local remap = vim.api.nvim_set_keymap
|
||||
local npairs = require "nvim-autopairs"
|
||||
|
||||
local cmp_autopairs = require "nvim-autopairs.completion.cmp"
|
||||
local cmp = require "cmp"
|
||||
npairs.setup { map_bs = false }
|
||||
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done {})
|
||||
vim.g.coq_settings = { keymap = { recommended = false } }
|
||||
|
||||
-- these mappings are coq recommended mappings unrelated to nvim-autopairs
|
||||
remap("i", "<esc>", [[pumvisible() ? "<c-e><esc>" : "<esc>"]], { expr = true, noremap = true })
|
||||
remap("i", "<c-c>", [[pumvisible() ? "<c-e><c-c>" : "<c-c>"]], { expr = true, noremap = true })
|
||||
remap("i", "<tab>", [[pumvisible() ? "<c-n>" : "<tab>"]], { expr = true, noremap = true })
|
||||
remap("i", "<s-tab>", [[pumvisible() ? "<c-p>" : "<bs>"]], { expr = true, noremap = true })
|
||||
|
||||
-- skip it, if you use another global object
|
||||
_G.MUtils = {}
|
||||
|
||||
MUtils.CR = function()
|
||||
if vim.fn.pumvisible() ~= 0 then
|
||||
if vim.fn.complete_info({ "selected" }).selected ~= -1 then
|
||||
return npairs.esc "<c-y>"
|
||||
else
|
||||
return npairs.esc "<c-e>" .. npairs.autopairs_cr()
|
||||
end
|
||||
else
|
||||
return npairs.autopairs_cr()
|
||||
end
|
||||
end
|
||||
remap("i", "<cr>", "v:lua.MUtils.CR()", { expr = true, noremap = true })
|
||||
|
||||
MUtils.BS = function()
|
||||
if vim.fn.pumvisible() ~= 0 and vim.fn.complete_info({ "mode" }).mode == "eval" then
|
||||
return npairs.esc "<c-e>" .. npairs.autopairs_bs()
|
||||
else
|
||||
return npairs.autopairs_bs()
|
||||
end
|
||||
end
|
||||
remap("i", "<bs>", "v:lua.MUtils.BS()", { expr = true, noremap = true })
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
@ -1,97 +1,96 @@
|
|||
local M = {
|
||||
"akinsho/bufferline.nvim",
|
||||
commit = "c7492a76ce8218e3335f027af44930576b561013",
|
||||
event = { "BufReadPre", "BufAdd", "BufNew", "BufReadPost" },
|
||||
dependencies = {
|
||||
{
|
||||
"famiu/bufdelete.nvim",
|
||||
commit = "8933abc09df6c381d47dc271b1ee5d266541448e",
|
||||
"akinsho/bufferline.nvim",
|
||||
event = { "BufReadPre", "BufAdd", "BufNew", "BufReadPost" },
|
||||
dependencies = {
|
||||
{
|
||||
"famiu/bufdelete.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
function M.config()
|
||||
require("bufferline").setup {
|
||||
options = {
|
||||
close_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||
right_mouse_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||
offsets = { { filetype = "NvimTree", text = "", padding = 1 } },
|
||||
separator_style = "thin", -- | "thick" | "thin" | { 'any', 'any' },
|
||||
},
|
||||
highlights = {
|
||||
fill = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
background = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
buffer_visible = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
close_button = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
close_button_visible = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
tab_selected = {
|
||||
fg = { attribute = "fg", highlight = "Normal" },
|
||||
bg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
tab = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
tab_close = {
|
||||
-- fg = {attribute='fg',highlight='LspDiagnosticsDefaultError'},
|
||||
fg = { attribute = "fg", highlight = "TabLineSel" },
|
||||
bg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
duplicate_selected = {
|
||||
fg = { attribute = "fg", highlight = "TabLineSel" },
|
||||
bg = { attribute = "bg", highlight = "TabLineSel" },
|
||||
italic = true,
|
||||
},
|
||||
duplicate_visible = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
italic = true,
|
||||
},
|
||||
duplicate = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
italic = true,
|
||||
},
|
||||
modified = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
modified_selected = {
|
||||
fg = { attribute = "fg", highlight = "Normal" },
|
||||
bg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
modified_visible = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
separator = {
|
||||
fg = { attribute = "bg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
separator_selected = {
|
||||
fg = { attribute = "bg", highlight = "Normal" },
|
||||
bg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
indicator_selected = {
|
||||
fg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" },
|
||||
bg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
},
|
||||
}
|
||||
require("bufferline").setup {
|
||||
options = {
|
||||
close_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||
right_mouse_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||
offsets = { { filetype = "NvimTree", text = "", padding = 1 } },
|
||||
separator_style = "thin", -- | "thick" | "thin" | { 'any', 'any' },
|
||||
},
|
||||
highlights = {
|
||||
fill = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
background = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
buffer_visible = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
close_button = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
close_button_visible = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
tab_selected = {
|
||||
fg = { attribute = "fg", highlight = "Normal" },
|
||||
bg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
tab = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
tab_close = {
|
||||
-- fg = {attribute='fg',highlight='LspDiagnosticsDefaultError'},
|
||||
fg = { attribute = "fg", highlight = "TabLineSel" },
|
||||
bg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
duplicate_selected = {
|
||||
fg = { attribute = "fg", highlight = "TabLineSel" },
|
||||
bg = { attribute = "bg", highlight = "TabLineSel" },
|
||||
italic = true,
|
||||
},
|
||||
duplicate_visible = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
italic = true,
|
||||
},
|
||||
duplicate = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
italic = true,
|
||||
},
|
||||
modified = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
modified_selected = {
|
||||
fg = { attribute = "fg", highlight = "Normal" },
|
||||
bg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
modified_visible = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
separator = {
|
||||
fg = { attribute = "bg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
separator_selected = {
|
||||
fg = { attribute = "bg", highlight = "Normal" },
|
||||
bg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
indicator_selected = {
|
||||
fg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" },
|
||||
bg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
169
lua/user/cmp.lua
169
lua/user/cmp.lua
|
@ -1,169 +0,0 @@
|
|||
local M = {
|
||||
"hrsh7th/nvim-cmp",
|
||||
commit = "cfafe0a1ca8933f7b7968a287d39904156f2c57d",
|
||||
dependencies = {
|
||||
{
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
commit = "0e6b2ed705ddcff9738ec4ea838141654f12eeef",
|
||||
},
|
||||
{
|
||||
"hrsh7th/cmp-buffer",
|
||||
commit = "3022dbc9166796b644a841a02de8dd1cc1d311fa",
|
||||
},
|
||||
{
|
||||
"hrsh7th/cmp-path",
|
||||
commit = "91ff86cd9c29299a64f968ebb45846c485725f23",
|
||||
},
|
||||
{
|
||||
"hrsh7th/cmp-cmdline",
|
||||
commit = "23c51b2a3c00f6abc4e922dbd7c3b9aca6992063",
|
||||
},
|
||||
{
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
commit = "18095520391186d634a0045dacaa346291096566",
|
||||
},
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
commit = "9bff06b570df29434a88f9c6a9cea3b21ca17208",
|
||||
event = "InsertEnter",
|
||||
dependencies = {
|
||||
"rafamadriz/friendly-snippets",
|
||||
commit = "a6f7a1609addb4e57daa6bedc300f77f8d225ab7",
|
||||
},
|
||||
},
|
||||
{
|
||||
"hrsh7th/cmp-nvim-lua",
|
||||
commit = "f3491638d123cfd2c8048aefaf66d246ff250ca6",
|
||||
},
|
||||
},
|
||||
event = {
|
||||
"InsertEnter",
|
||||
"CmdlineEnter",
|
||||
},
|
||||
}
|
||||
|
||||
function M.config()
|
||||
local cmp = require "cmp"
|
||||
local luasnip = require "luasnip"
|
||||
require("luasnip/loaders/from_vscode").lazy_load()
|
||||
|
||||
local check_backspace = function()
|
||||
local col = vim.fn.col "." - 1
|
||||
return col == 0 or vim.fn.getline("."):sub(col, col):match "%s"
|
||||
end
|
||||
|
||||
local kind_icons = {
|
||||
Text = "",
|
||||
Method = "m",
|
||||
Function = "",
|
||||
Constructor = "",
|
||||
Field = "",
|
||||
Variable = "",
|
||||
Class = "",
|
||||
Interface = "",
|
||||
Module = "",
|
||||
Property = "",
|
||||
Unit = "",
|
||||
Value = "",
|
||||
Enum = "",
|
||||
Keyword = "",
|
||||
Snippet = "",
|
||||
Color = "",
|
||||
File = "",
|
||||
Reference = "",
|
||||
Folder = "",
|
||||
EnumMember = "",
|
||||
Constant = "",
|
||||
Struct = "",
|
||||
Event = "",
|
||||
Operator = "",
|
||||
TypeParameter = "",
|
||||
Codeium = "",
|
||||
Copilot = "",
|
||||
}
|
||||
|
||||
cmp.setup {
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body) -- For `luasnip` users.
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert {
|
||||
["<C-k>"] = cmp.mapping.select_prev_item(),
|
||||
["<C-j>"] = cmp.mapping.select_next_item(),
|
||||
["<C-b>"] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }),
|
||||
["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }),
|
||||
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
|
||||
["<C-e>"] = cmp.mapping {
|
||||
i = cmp.mapping.abort(),
|
||||
c = cmp.mapping.close(),
|
||||
},
|
||||
-- Accept currently selected item. If none selected, `select` first item.
|
||||
-- Set `select` to `false` to only confirm explicitly selected items.
|
||||
["<CR>"] = cmp.mapping.confirm { select = true },
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expandable() then
|
||||
luasnip.expand()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
elseif check_backspace() then
|
||||
fallback()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, {
|
||||
"i",
|
||||
"s",
|
||||
}),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, {
|
||||
"i",
|
||||
"s",
|
||||
}),
|
||||
},
|
||||
formatting = {
|
||||
fields = { "kind", "abbr", "menu" },
|
||||
format = function(entry, vim_item)
|
||||
vim_item.kind = kind_icons[vim_item.kind]
|
||||
vim_item.menu = ({
|
||||
nvim_lsp = "",
|
||||
nvim_lua = "",
|
||||
luasnip = "",
|
||||
buffer = "",
|
||||
path = "",
|
||||
emoji = "",
|
||||
})[entry.source.name]
|
||||
return vim_item
|
||||
end,
|
||||
},
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "nvim_lua" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
},
|
||||
confirm_opts = {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = false,
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
experimental = {
|
||||
ghost_text = true,
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
return M
|
|
@ -89,6 +89,7 @@ function M.config()
|
|||
Group.new('Macro' , colors.foreground)
|
||||
Group.new('PreProc' , colors.foreground)
|
||||
Group.new('NormalFloat' , colors.foreground)
|
||||
Group.new('MatchParen' , colors.foreground , colors.purple , styles.bold )
|
||||
|
||||
Group.new('Directory' , colors.foreground)
|
||||
Group.new('netrwList' , colors.yellow)
|
||||
|
@ -125,8 +126,6 @@ function M.config()
|
|||
Group.new('Define' , colors.green , colors.none , styles.italic )
|
||||
Group.new('Function' , colors.green , colors.none , styles.italic )
|
||||
Group.new('luaFunctionCall' , groups.Function , groups.Function , groups.Function)
|
||||
|
||||
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
local M = {
|
||||
"norcalli/nvim-colorizer.lua",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
"norcalli/nvim-colorizer.lua",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
}
|
||||
|
||||
function M.config()
|
||||
require("colorizer").setup()
|
||||
require("colorizer").setup({
|
||||
"*",
|
||||
}, {
|
||||
rgb_fn = true,
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
local M = {
|
||||
'ms-jpq/coq_nvim',
|
||||
branch = "coq",
|
||||
lazy = false,
|
||||
}
|
||||
|
||||
|
||||
function M.config()
|
||||
vim.api.nvim_command(":COQnow")
|
||||
end
|
||||
|
||||
return M
|
|
@ -0,0 +1,20 @@
|
|||
local M = {
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
lazy = false,
|
||||
}
|
||||
|
||||
function M.config()
|
||||
vim.opt.termguicolors = true
|
||||
vim.cmd [[highlight IndentBlanklineIndent1 guifg=#2A2A2A gui=nocombine]]
|
||||
|
||||
vim.opt.list = true
|
||||
|
||||
require("indent_blankline").setup {
|
||||
space_char_blankline = " ",
|
||||
char_highlight_list = {
|
||||
"IndentBlanklineIndent1",
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
return M
|
|
@ -1,32 +1,33 @@
|
|||
M = {
|
||||
"VonHeikemen/lsp-zero.nvim",
|
||||
branch = "v2.x",
|
||||
dependencies = {
|
||||
-- LSP Support
|
||||
{ "neovim/nvim-lspconfig" }, -- Required
|
||||
{ "williamboman/mason.nvim" }, -- Optional
|
||||
{ "williamboman/mason-lspconfig.nvim" }, -- Optional
|
||||
"VonHeikemen/lsp-zero.nvim",
|
||||
branch = "v2.x",
|
||||
dependencies = {
|
||||
-- LSP Support
|
||||
{ "neovim/nvim-lspconfig" }, -- Required
|
||||
{ "williamboman/mason.nvim" }, -- Optional
|
||||
{ "williamboman/mason-lspconfig.nvim" }, -- Optional
|
||||
|
||||
-- Autocompletion
|
||||
{ "hrsh7th/nvim-cmp" }, -- Required
|
||||
{ "hrsh7th/cmp-nvim-lsp" }, -- Required
|
||||
{ "L3MON4D3/LuaSnip" }, -- Required
|
||||
},
|
||||
-- Autocompletion
|
||||
{ "hrsh7th/nvim-cmp" }, -- Required
|
||||
{ "hrsh7th/cmp-nvim-lsp" }, -- Required
|
||||
{ "L3MON4D3/LuaSnip" }, -- Required
|
||||
},
|
||||
}
|
||||
|
||||
function M.config()
|
||||
local lsp = require("lsp-zero").preset {}
|
||||
local lsp = require("lsp-zero").preset {}
|
||||
|
||||
lsp.on_attach(function(client, bufnr)
|
||||
-- see :help lsp-zero-keybindings
|
||||
-- to learn the available actions
|
||||
lsp.default_keymaps { buffer = bufnr }
|
||||
end)
|
||||
lsp.on_attach(function(client, bufnr)
|
||||
-- see :help lsp-zero-keybindings
|
||||
-- to learn the available actions
|
||||
lsp.default_keymaps { buffer = bufnr }
|
||||
end)
|
||||
|
||||
-- (Optional) Configure lua language server for neovim
|
||||
require("lspconfig").lua_ls.setup(lsp.nvim_lua_ls())
|
||||
-- (Optional) Configure lua language server for neovim
|
||||
require("lspconfig").lua_ls.setup(lsp.nvim_lua_ls())
|
||||
require("lspconfig").gopls.setup {}
|
||||
|
||||
lsp.setup()
|
||||
lsp.setup()
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
174
lua/user/lsp.lua
174
lua/user/lsp.lua
|
@ -1,105 +1,105 @@
|
|||
local M = {
|
||||
"neovim/nvim-lspconfig",
|
||||
commit = "649137cbc53a044bffde36294ce3160cb18f32c7",
|
||||
lazy = false,
|
||||
event = { "BufReadPre" },
|
||||
dependencies = {
|
||||
{
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
commit = "0e6b2ed705ddcff9738ec4ea838141654f12eeef",
|
||||
"neovim/nvim-lspconfig",
|
||||
commit = "649137cbc53a044bffde36294ce3160cb18f32c7",
|
||||
lazy = false,
|
||||
event = { "BufReadPre" },
|
||||
dependencies = {
|
||||
{
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
commit = "0e6b2ed705ddcff9738ec4ea838141654f12eeef",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
function M.config()
|
||||
local cmp_nvim_lsp = require "cmp_nvim_lsp"
|
||||
local cmp_nvim_lsp = require "cmp_nvim_lsp"
|
||||
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
capabilities = cmp_nvim_lsp.default_capabilities(M.capabilities)
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
capabilities = cmp_nvim_lsp.default_capabilities(M.capabilities)
|
||||
|
||||
local function lsp_keymaps(bufnr)
|
||||
local opts = { noremap = true, silent = true }
|
||||
local keymap = vim.api.nvim_buf_set_keymap
|
||||
keymap(bufnr, "n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", opts)
|
||||
keymap(bufnr, "n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
||||
keymap(bufnr, "n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>", opts)
|
||||
keymap(bufnr, "n", "gI", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
|
||||
keymap(bufnr, "n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
|
||||
keymap(bufnr, "n", "gl", "<cmd>lua vim.diagnostic.open_float()<CR>", opts)
|
||||
keymap(bufnr, "n", "<leader>li", "<cmd>LspInfo<cr>", opts)
|
||||
keymap(bufnr, "n", "<leader>lI", "<cmd>Mason<cr>", opts)
|
||||
keymap(bufnr, "n", "<leader>la", "<cmd>lua vim.lsp.buf.code_action()<cr>", opts)
|
||||
keymap(bufnr, "n", "<leader>lj", "<cmd>lua vim.diagnostic.goto_next({buffer=0})<cr>", opts)
|
||||
keymap(bufnr, "n", "<leader>lk", "<cmd>lua vim.diagnostic.goto_prev({buffer=0})<cr>", opts)
|
||||
keymap(bufnr, "n", "<leader>lr", "<cmd>lua vim.lsp.buf.rename()<cr>", opts)
|
||||
keymap(bufnr, "n", "<leader>ls", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
|
||||
keymap(bufnr, "n", "<leader>lq", "<cmd>lua vim.diagnostic.setloclist()<CR>", opts)
|
||||
end
|
||||
|
||||
local lspconfig = require "lspconfig"
|
||||
local on_attach = function(client, bufnr)
|
||||
lsp_keymaps(bufnr)
|
||||
require("illuminate").on_attach(client)
|
||||
end
|
||||
|
||||
for _, server in pairs(require("utils").servers) do
|
||||
Opts = {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
|
||||
server = vim.split(server, "@")[1]
|
||||
|
||||
local require_ok, conf_opts = pcall(require, "settings." .. server)
|
||||
if require_ok then
|
||||
Opts = vim.tbl_deep_extend("force", conf_opts, Opts)
|
||||
local function lsp_keymaps(bufnr)
|
||||
local opts = { noremap = true, silent = true }
|
||||
local keymap = vim.api.nvim_buf_set_keymap
|
||||
keymap(bufnr, "n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", opts)
|
||||
keymap(bufnr, "n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
||||
keymap(bufnr, "n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>", opts)
|
||||
keymap(bufnr, "n", "gI", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
|
||||
keymap(bufnr, "n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
|
||||
keymap(bufnr, "n", "gl", "<cmd>lua vim.diagnostic.open_float()<CR>", opts)
|
||||
keymap(bufnr, "n", "<leader>li", "<cmd>LspInfo<cr>", opts)
|
||||
keymap(bufnr, "n", "<leader>lI", "<cmd>Mason<cr>", opts)
|
||||
keymap(bufnr, "n", "<leader>la", "<cmd>lua vim.lsp.buf.code_action()<cr>", opts)
|
||||
keymap(bufnr, "n", "<leader>lj", "<cmd>lua vim.diagnostic.goto_next({buffer=0})<cr>", opts)
|
||||
keymap(bufnr, "n", "<leader>lk", "<cmd>lua vim.diagnostic.goto_prev({buffer=0})<cr>", opts)
|
||||
keymap(bufnr, "n", "<leader>lr", "<cmd>lua vim.lsp.buf.rename()<cr>", opts)
|
||||
keymap(bufnr, "n", "<leader>ls", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
|
||||
keymap(bufnr, "n", "<leader>lq", "<cmd>lua vim.diagnostic.setloclist()<CR>", opts)
|
||||
end
|
||||
|
||||
lspconfig[server].setup(Opts)
|
||||
end
|
||||
local lspconfig = require "lspconfig"
|
||||
local on_attach = function(client, bufnr)
|
||||
lsp_keymaps(bufnr)
|
||||
require("illuminate").on_attach(client)
|
||||
end
|
||||
|
||||
local signs = {
|
||||
{ name = "DiagnosticSignError", text = "" },
|
||||
{ name = "DiagnosticSignWarn", text = "" },
|
||||
{ name = "DiagnosticSignHint", text = "" },
|
||||
{ name = "DiagnosticSignInfo", text = "" },
|
||||
}
|
||||
for _, server in pairs(require("utils").servers) do
|
||||
Opts = {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
|
||||
for _, sign in ipairs(signs) do
|
||||
vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" })
|
||||
end
|
||||
server = vim.split(server, "@")[1]
|
||||
|
||||
local config = {
|
||||
-- disable virtual text
|
||||
virtual_text = false,
|
||||
-- show signs
|
||||
signs = {
|
||||
active = signs,
|
||||
},
|
||||
update_in_insert = true,
|
||||
underline = true,
|
||||
severity_sort = true,
|
||||
float = {
|
||||
focusable = false,
|
||||
style = "minimal",
|
||||
border = "rounded",
|
||||
source = "always",
|
||||
header = "",
|
||||
prefix = "",
|
||||
suffix = "",
|
||||
},
|
||||
}
|
||||
local require_ok, conf_opts = pcall(require, "settings." .. server)
|
||||
if require_ok then
|
||||
Opts = vim.tbl_deep_extend("force", conf_opts, Opts)
|
||||
end
|
||||
|
||||
vim.diagnostic.config(config)
|
||||
lspconfig[server].setup(Opts)
|
||||
end
|
||||
|
||||
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
|
||||
border = "rounded",
|
||||
})
|
||||
local signs = {
|
||||
{ name = "DiagnosticSignError", text = "" },
|
||||
{ name = "DiagnosticSignWarn", text = "" },
|
||||
{ name = "DiagnosticSignHint", text = "" },
|
||||
{ name = "DiagnosticSignInfo", text = "" },
|
||||
}
|
||||
|
||||
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
|
||||
border = "rounded",
|
||||
})
|
||||
for _, sign in ipairs(signs) do
|
||||
vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" })
|
||||
end
|
||||
|
||||
local config = {
|
||||
-- disable virtual text
|
||||
virtual_text = false,
|
||||
-- show signs
|
||||
signs = {
|
||||
active = signs,
|
||||
},
|
||||
update_in_insert = true,
|
||||
underline = true,
|
||||
severity_sort = true,
|
||||
float = {
|
||||
focusable = false,
|
||||
style = "minimal",
|
||||
border = "rounded",
|
||||
source = "always",
|
||||
header = "",
|
||||
prefix = "",
|
||||
suffix = "",
|
||||
},
|
||||
}
|
||||
|
||||
vim.diagnostic.config(config)
|
||||
|
||||
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
|
||||
|
||||
return M
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
local M = {
|
||||
"karb94/neoscroll.nvim",
|
||||
lazy = false
|
||||
}
|
||||
|
||||
function M.config()
|
||||
require('neoscroll').setup()
|
||||
end
|
||||
|
||||
return M
|
|
@ -1,7 +0,0 @@
|
|||
local M = {
|
||||
"AlphaTechnolog/pywal.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
}
|
||||
|
||||
return M
|
|
@ -1,14 +1,15 @@
|
|||
local M = {}
|
||||
|
||||
M.servers = {
|
||||
"lua_ls",
|
||||
"cssls",
|
||||
"html",
|
||||
"tsserver",
|
||||
"pyright",
|
||||
"bashls",
|
||||
"jsonls",
|
||||
"yamlls",
|
||||
"lua_ls",
|
||||
"cssls",
|
||||
"html",
|
||||
"tsserver",
|
||||
"pyright",
|
||||
"bashls",
|
||||
"jsonls",
|
||||
"yamlls",
|
||||
"gopls",
|
||||
}
|
||||
|
||||
return M
|
||||
|
|
Loading…
Reference in New Issue