autoforamtted everything
This commit is contained in:
parent
1dc2308a1f
commit
622145d183
12 changed files with 184 additions and 195 deletions
|
@ -1,9 +1,8 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"echasnovski/mini.comment",
|
"echasnovski/mini.comment",
|
||||||
config = function ()
|
config = function()
|
||||||
require("mini.comment").setup()
|
require("mini.comment").setup()
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,15 +2,15 @@ return {
|
||||||
{
|
{
|
||||||
'tpope/vim-fugitive',
|
'tpope/vim-fugitive',
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>Gs", "<cmd>Git status <cr>", desc = "git status" },
|
{ "<leader>Gs", "<cmd>Git status <cr>", desc = "git status" },
|
||||||
{ "<leader>Gd", "<cmd>Git diff <cr>", desc = "git diff" },
|
{ "<leader>Gd", "<cmd>Git diff <cr>", desc = "git diff" },
|
||||||
{ "<leader>GD", "<cmd>Git diff --staged <cr>", desc = "git diff --staged" },
|
{ "<leader>GD", "<cmd>Git diff --staged <cr>", desc = "git diff --staged" },
|
||||||
{ "<leader>Gl", "<cmd>Git log --graph <cr>", desc = "git log --graph" },
|
{ "<leader>Gl", "<cmd>Git log --graph <cr>", desc = "git log --graph" },
|
||||||
{ "<leader>Ga", "<cmd>Git add --interactive <cr>", desc = "git add" },
|
{ "<leader>Ga", "<cmd>Git add --interactive <cr>", desc = "git add" },
|
||||||
{ "<leader>GA", "<cmd>Git add -A <cr>", desc = "git add -A " },
|
{ "<leader>GA", "<cmd>Git add -A <cr>", desc = "git add -A " },
|
||||||
{ "<leader>Gc", "<cmd>Git commit <cr>", desc = "git commit" },
|
{ "<leader>Gc", "<cmd>Git commit <cr>", desc = "git commit" },
|
||||||
{ "<leader>GC", "<cmd>Git commit --amend <cr>", desc = "git commit --amend " },
|
{ "<leader>GC", "<cmd>Git commit --amend <cr>", desc = "git commit --amend " },
|
||||||
{ "<leader>Gp", "<cmd>Git push <cr>", desc = "git push" },
|
{ "<leader>Gp", "<cmd>Git push <cr>", desc = "git push" },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ return {
|
||||||
{
|
{
|
||||||
'lewis6991/gitsigns.nvim',
|
'lewis6991/gitsigns.nvim',
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
config = function ()
|
config = function()
|
||||||
require('gitsigns').setup({
|
require('gitsigns').setup({
|
||||||
preview_config = {
|
preview_config = {
|
||||||
border = 'rounded',
|
border = 'rounded',
|
||||||
|
@ -21,29 +21,29 @@ return {
|
||||||
if vim.wo.diff then return ']c' end
|
if vim.wo.diff then return ']c' end
|
||||||
vim.schedule(function() gs.next_hunk() end)
|
vim.schedule(function() gs.next_hunk() end)
|
||||||
return '<Ignore>'
|
return '<Ignore>'
|
||||||
end, {expr=true})
|
end, { expr = true })
|
||||||
|
|
||||||
map('n', '[c', function()
|
map('n', '[c', function()
|
||||||
if vim.wo.diff then return '[c' end
|
if vim.wo.diff then return '[c' end
|
||||||
vim.schedule(function() gs.prev_hunk() end)
|
vim.schedule(function() gs.prev_hunk() end)
|
||||||
return '<Ignore>'
|
return '<Ignore>'
|
||||||
end, {expr=true})
|
end, { expr = true })
|
||||||
|
|
||||||
-- Actions
|
-- Actions
|
||||||
map({'n', 'v'}, '<leader>hs', ':Gitsigns stage_hunk<CR>')
|
map({ 'n', 'v' }, '<leader>hs', ':Gitsigns stage_hunk<CR>')
|
||||||
map({'n', 'v'}, '<leader>hr', ':Gitsigns reset_hunk<CR>')
|
map({ 'n', 'v' }, '<leader>hr', ':Gitsigns reset_hunk<CR>')
|
||||||
map('n', '<leader>hS', gs.stage_buffer)
|
map('n', '<leader>hS', gs.stage_buffer)
|
||||||
map('n', '<leader>hu', gs.undo_stage_hunk)
|
map('n', '<leader>hu', gs.undo_stage_hunk)
|
||||||
map('n', '<leader>hR', gs.reset_buffer)
|
map('n', '<leader>hR', gs.reset_buffer)
|
||||||
map('n', '<leader>hp', gs.preview_hunk)
|
map('n', '<leader>hp', gs.preview_hunk)
|
||||||
map('n', '<leader>hb', function() gs.blame_line{full=true} end)
|
map('n', '<leader>hb', function() gs.blame_line { full = true } end)
|
||||||
map('n', '<leader>tb', gs.toggle_current_line_blame)
|
map('n', '<leader>tb', gs.toggle_current_line_blame)
|
||||||
map('n', '<leader>hd', gs.diffthis)
|
map('n', '<leader>hd', gs.diffthis)
|
||||||
map('n', '<leader>hD', function() gs.diffthis('~') end)
|
map('n', '<leader>hD', function() gs.diffthis('~') end)
|
||||||
map('n', '<leader>td', gs.toggle_deleted)
|
map('n', '<leader>td', gs.toggle_deleted)
|
||||||
|
|
||||||
-- Text object
|
-- Text object
|
||||||
map({'o', 'x'}, 'ih', ':<C-U>Gitsigns select_hunk<CR>')
|
map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>')
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
|
|
@ -12,54 +12,53 @@ return {
|
||||||
vim.api.nvim_set_var("gruvbox_material_enable_italic", "1")
|
vim.api.nvim_set_var("gruvbox_material_enable_italic", "1")
|
||||||
vim.api.nvim_set_var("gruvbox_material_better_performance", "1")
|
vim.api.nvim_set_var("gruvbox_material_better_performance", "1")
|
||||||
vim.cmd([[colo gruvbox-material]])
|
vim.cmd([[colo gruvbox-material]])
|
||||||
|
|
||||||
-- Settings to override colorscheme
|
-- Settings to override colorscheme
|
||||||
-- vim.api.nvim_set_hl(0, "ModeMsg", { bold = true, fg = "#d8a657"})
|
-- vim.api.nvim_set_hl(0, "ModeMsg", { bold = true, fg = "#d8a657"})
|
||||||
-- colors of tabline
|
-- colors of tabline
|
||||||
vim.api.nvim_set_hl(0, "TabLine", {bg = "#3c3836", fg = "#89b482"})
|
vim.api.nvim_set_hl(0, "TabLine", { bg = "#3c3836", fg = "#89b482" })
|
||||||
vim.api.nvim_set_hl(0, "TabLineFil", {bg = "#1d2021"})
|
vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#1d2021" })
|
||||||
vim.api.nvim_set_hl(0, "TabLineSel", {bold = true, bg = "none", fg = "#d8a657"})
|
vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" })
|
||||||
-- color of statusline
|
-- color of statusline
|
||||||
vim.api.nvim_set_hl(0, "StatusLine", {bold = false, bg = "#1d2021", fg = "#89b482"})
|
vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" })
|
||||||
vim.api.nvim_set_hl(0, "StatusLineNC", {bg = "#1d2021", fg = "#5b534d"})
|
vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" })
|
||||||
-- color of vertical split line
|
-- color of vertical split line
|
||||||
vim.api.nvim_set_hl(0, "VertSplit", {bg = "#141617", fg = "#141617"})
|
vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" })
|
||||||
-- color of the cursorline and cursorlinenumber
|
-- color of the cursorline and cursorlinenumber
|
||||||
vim.api.nvim_set_hl(0, "Cursorline", {bg = "#141617"})
|
vim.api.nvim_set_hl(0, "Cursorline", { bg = "#141617" })
|
||||||
vim.api.nvim_set_hl(0, "CursorLineNr", {bold = true, bg = "#141617", fg = "#d8a657"})
|
vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, bg = "#141617", fg = "#d8a657" })
|
||||||
-- color of Floats and FloatBorders
|
-- color of Floats and FloatBorders
|
||||||
vim.api.nvim_set_hl(0, "NormalFloat", {bg = none, fg = none })
|
vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none })
|
||||||
vim.api.nvim_set_hl(0, "FloatBorder", {bg = none, fg = "#d4be98"})
|
vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#d4be98" })
|
||||||
vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", {bg = none, fg = "#d8a657"})
|
vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#d8a657" })
|
||||||
vim.api.nvim_set_hl(0, "DiagnosticFloatingError", {bg = none, fg = "#ea6962"})
|
vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#ea6962" })
|
||||||
vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", {bg = none, fg = "#a9b665"})
|
vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#a9b665" })
|
||||||
vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", {bg = none, fg = "#d4be98"})
|
vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#d4be98" })
|
||||||
|
|
||||||
-- autocommand for overrides
|
-- autocommand for overrides
|
||||||
vim.api.nvim_create_autocmd("ColorScheme", {
|
vim.api.nvim_create_autocmd("ColorScheme", {
|
||||||
pattern = "gruvbox-material",
|
pattern = "gruvbox-material",
|
||||||
callback = function ()
|
callback = function()
|
||||||
vim.api.nvim_set_hl(0, "TabLine", {bg = "#3c3836", fg = "#89b482"})
|
vim.api.nvim_set_hl(0, "TabLine", { bg = "#3c3836", fg = "#89b482" })
|
||||||
vim.api.nvim_set_hl(0, "TabLineFil", {bg = "#1d2021"})
|
vim.api.nvim_set_hl(0, "TabLineFil", { bg = "#1d2021" })
|
||||||
vim.api.nvim_set_hl(0, "TabLineSel", {bold = true, bg = "none", fg = "#d8a657"})
|
vim.api.nvim_set_hl(0, "TabLineSel", { bold = true, bg = "none", fg = "#d8a657" })
|
||||||
-- color of statusline
|
-- color of statusline
|
||||||
vim.api.nvim_set_hl(0, "StatusLine", {bold = false, bg = "#1d2021", fg = "#89b482"})
|
vim.api.nvim_set_hl(0, "StatusLine", { bold = false, bg = "#1d2021", fg = "#89b482" })
|
||||||
vim.api.nvim_set_hl(0, "StatusLineNC", {bg = "#1d2021", fg = "#5b534d"})
|
vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "#1d2021", fg = "#5b534d" })
|
||||||
-- color of vertical split line
|
-- color of vertical split line
|
||||||
vim.api.nvim_set_hl(0, "VertSplit", {bg = "#141617", fg = "#141617"})
|
vim.api.nvim_set_hl(0, "VertSplit", { bg = "#141617", fg = "#141617" })
|
||||||
-- color of the cursorline and cursorlinenumber
|
-- color of the cursorline and cursorlinenumber
|
||||||
vim.api.nvim_set_hl(0, "Cursorline", {bg = "#141617"})
|
vim.api.nvim_set_hl(0, "Cursorline", { bg = "#141617" })
|
||||||
vim.api.nvim_set_hl(0, "CursorLineNr", {bold = true, bg = "#141617", fg = "#d8a657"})
|
vim.api.nvim_set_hl(0, "CursorLineNr", { bold = true, bg = "#141617", fg = "#d8a657" })
|
||||||
-- color of Floats and FloatBorders
|
-- color of Floats and FloatBorders
|
||||||
vim.api.nvim_set_hl(0, "NormalFloat", {bg = none, fg = none })
|
vim.api.nvim_set_hl(0, "NormalFloat", { bg = none, fg = none })
|
||||||
vim.api.nvim_set_hl(0, "FloatBorder", {bg = none, fg = "#d4be98"})
|
vim.api.nvim_set_hl(0, "FloatBorder", { bg = none, fg = "#d4be98" })
|
||||||
vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", {bg = none, fg = "#d8a657"})
|
vim.api.nvim_set_hl(0, "DiagnosticFloatingWarn", { bg = none, fg = "#d8a657" })
|
||||||
vim.api.nvim_set_hl(0, "DiagnosticFloatingError", {bg = none, fg = "#ea6962"})
|
vim.api.nvim_set_hl(0, "DiagnosticFloatingError", { bg = none, fg = "#ea6962" })
|
||||||
vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", {bg = none, fg = "#a9b665"})
|
vim.api.nvim_set_hl(0, "DiagnosticFloatingHint", { bg = none, fg = "#a9b665" })
|
||||||
vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", {bg = none, fg = "#d4be98"})
|
vim.api.nvim_set_hl(0, "DiagnosticFloatingInfo", { bg = none, fg = "#d4be98" })
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ return {
|
||||||
-- event = "BufReadPre",
|
-- event = "BufReadPre",
|
||||||
config = function()
|
config = function()
|
||||||
require('lspconfig.ui.windows').default_options.border = 'rounded'
|
require('lspconfig.ui.windows').default_options.border = 'rounded'
|
||||||
vim.api.nvim_set_hl(0, "LspInfoBorder", {bg = none, fg = "#d4be98"})
|
vim.api.nvim_set_hl(0, "LspInfoBorder", { bg = none, fg = "#d4be98" })
|
||||||
local opts = { noremap = true, silent = true }
|
local opts = { noremap = true, silent = true }
|
||||||
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
|
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
|
||||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
|
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
|
||||||
|
@ -61,7 +61,6 @@ return {
|
||||||
prefix = '●', -- Could be '●', '■', 'x', '▎'
|
prefix = '●', -- Could be '●', '■', 'x', '▎'
|
||||||
},
|
},
|
||||||
update_in_insert = true
|
update_in_insert = true
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
-- LSP settings (for overriding per client)
|
-- LSP settings (for overriding per client)
|
||||||
|
@ -115,4 +114,3 @@ return {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@ return {
|
||||||
{
|
{
|
||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
vim.api.nvim_set_option("showmode",false)
|
vim.api.nvim_set_option("showmode", false)
|
||||||
local custom_gruvbox = require'lualine.themes.gruvbox-material'
|
local custom_gruvbox = require 'lualine.themes.gruvbox-material'
|
||||||
custom_gruvbox.normal.a.bg = '#89b482'
|
custom_gruvbox.normal.a.bg = '#89b482'
|
||||||
custom_gruvbox.normal.c.bg = '#141617'
|
custom_gruvbox.normal.c.bg = '#141617'
|
||||||
custom_gruvbox.insert.a.bg = '#d8a657'
|
custom_gruvbox.insert.a.bg = '#d8a657'
|
||||||
|
@ -16,26 +16,26 @@ return {
|
||||||
component_separators = ' '
|
component_separators = ' '
|
||||||
},
|
},
|
||||||
sections = {
|
sections = {
|
||||||
lualine_a = {'mode'},
|
lualine_a = { 'mode' },
|
||||||
lualine_b = {
|
lualine_b = {
|
||||||
{
|
{
|
||||||
'branch',
|
'branch',
|
||||||
icon = '',
|
icon = '',
|
||||||
color={fg='#d8a657', bg='#141617', gui='bold' },
|
color = { fg = '#d8a657', bg = '#141617', gui = 'bold' },
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
lualine_c = {
|
lualine_c = {
|
||||||
{
|
{
|
||||||
'filename',
|
'filename',
|
||||||
color={gui='italic', fg='#d3869b', bg='#1d2021'},
|
color = { gui = 'italic', fg = '#d3869b', bg = '#1d2021' },
|
||||||
path = 1,
|
path = 1,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
lualine_x = {
|
lualine_x = {
|
||||||
{
|
{
|
||||||
'filetype',
|
'filetype',
|
||||||
color={bg='#1d2021', fg='#d4be98', gui='italic'},
|
color = { bg = '#1d2021', fg = '#d4be98', gui = 'italic' },
|
||||||
fmt = function (str)
|
fmt = function(str)
|
||||||
return (str:gsub("^%l", string.upper))
|
return (str:gsub("^%l", string.upper))
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ return {
|
||||||
lualine_y = {
|
lualine_y = {
|
||||||
{
|
{
|
||||||
'diagnostics',
|
'diagnostics',
|
||||||
color={gui='bold', bg='#141617'},
|
color = { gui = 'bold', bg = '#141617' },
|
||||||
sections = { 'error', 'warn', 'info', 'hint' },
|
sections = { 'error', 'warn', 'info', 'hint' },
|
||||||
symbols = { error = "✘ ", warn = " ", info = " ", hint = " " },
|
symbols = { error = "✘ ", warn = " ", info = " ", hint = " " },
|
||||||
update_in_insert = true
|
update_in_insert = true
|
||||||
|
@ -51,15 +51,15 @@ return {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'diff',
|
'diff',
|
||||||
icon = {' ', color={bg='#141617', fg='#d8a657', gui='bold'}},
|
icon = { ' ', color = { bg = '#141617', fg = '#d8a657', gui = 'bold' } },
|
||||||
color={gui='bold', bg='#141617'},
|
color = { gui = 'bold', bg = '#141617' },
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
lualine_z = {'location'}
|
lualine_z = { 'location' }
|
||||||
},
|
},
|
||||||
|
|
||||||
inactive_sections = {
|
inactive_sections = {
|
||||||
lualine_a = {'mode'},
|
lualine_a = { 'mode' },
|
||||||
lualine_b = {
|
lualine_b = {
|
||||||
{
|
{
|
||||||
'branch',
|
'branch',
|
||||||
|
@ -75,8 +75,8 @@ return {
|
||||||
lualine_x = {
|
lualine_x = {
|
||||||
{
|
{
|
||||||
'filetype',
|
'filetype',
|
||||||
color={gui='italic'},
|
color = { gui = 'italic' },
|
||||||
fmt = function (str)
|
fmt = function(str)
|
||||||
return (str:gsub("^%l", string.upper))
|
return (str:gsub("^%l", string.upper))
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ return {
|
||||||
lualine_y = {
|
lualine_y = {
|
||||||
{
|
{
|
||||||
'diagnostics',
|
'diagnostics',
|
||||||
color={gui='bold', bg='#141617'},
|
color = { gui = 'bold', bg = '#141617' },
|
||||||
sections = { 'error', 'warn', 'info', 'hint' },
|
sections = { 'error', 'warn', 'info', 'hint' },
|
||||||
symbols = { error = "✘ ", warn = " ", info = " ", hint = " " },
|
symbols = { error = "✘ ", warn = " ", info = " ", hint = " " },
|
||||||
update_in_insert = true
|
update_in_insert = true
|
||||||
|
@ -92,14 +92,13 @@ return {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'diff',
|
'diff',
|
||||||
icon = {' ', color={bg='#141617', gui='bold'}},
|
icon = { ' ', color = { bg = '#141617', gui = 'bold' } },
|
||||||
color={gui='bold', bg='#141617'},
|
color = { gui = 'bold', bg = '#141617' },
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
lualine_z = {'location'}
|
lualine_z = { 'location' }
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,21 +6,21 @@ return {
|
||||||
{
|
{
|
||||||
"nvim-telescope/telescope-ui-select.nvim",
|
"nvim-telescope/telescope-ui-select.nvim",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
config = function ()
|
config = function()
|
||||||
-- This is your opts table
|
-- This is your opts table
|
||||||
require("telescope").setup {
|
require("telescope").setup {
|
||||||
extensions = {
|
extensions = {
|
||||||
["ui-select"] = {
|
["ui-select"] = {
|
||||||
-- require("telescope.themes").get_dropdown {
|
-- require("telescope.themes").get_dropdown {
|
||||||
-- -- even more opts
|
-- -- even more opts
|
||||||
-- }
|
-- }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
require("telescope").load_extension("ui-select")
|
}
|
||||||
end,
|
require("telescope").load_extension("ui-select")
|
||||||
},
|
end,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
opts = function()
|
opts = function()
|
||||||
local null_ls = require('null-ls')
|
local null_ls = require('null-ls')
|
||||||
return {
|
return {
|
||||||
|
@ -39,7 +39,7 @@ return {
|
||||||
vim.keymap.set('n', '<space>fm', function() vim.lsp.buf.format { async = true } end, bufopts)
|
vim.keymap.set('n', '<space>fm', function() vim.lsp.buf.format { async = true } end, bufopts)
|
||||||
end,
|
end,
|
||||||
sources = {
|
sources = {
|
||||||
null_ls.builtins.diagnostics.trail_space.with{
|
null_ls.builtins.diagnostics.trail_space.with {
|
||||||
disabled_filetypes = { "lua" }
|
disabled_filetypes = { "lua" }
|
||||||
},
|
},
|
||||||
null_ls.builtins.diagnostics.shellcheck,
|
null_ls.builtins.diagnostics.shellcheck,
|
||||||
|
@ -51,4 +51,3 @@ return {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,14 +8,14 @@ return {
|
||||||
"rafamadriz/friendly-snippets",
|
"rafamadriz/friendly-snippets",
|
||||||
config = function()
|
config = function()
|
||||||
require("luasnip.loaders.from_vscode").lazy_load()
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
vim.api.nvim_set_hl( 0, "PmenuSel", { fg = 'NONE', bg = '#141617' } )
|
vim.api.nvim_set_hl(0, "PmenuSel", { fg = 'NONE', bg = '#141617' })
|
||||||
vim.api.nvim_set_hl( 0, "Pmenu", { fg = 'NONE', bg = '#1d2021' } )
|
vim.api.nvim_set_hl(0, "Pmenu", { fg = 'NONE', bg = '#1d2021' })
|
||||||
vim.api.nvim_set_hl( 0, "CmpItemMenu", { fg = 'NONE', bg = '#141617' } )
|
vim.api.nvim_set_hl(0, "CmpItemMenu", { fg = 'NONE', bg = '#141617' })
|
||||||
vim.api.nvim_set_hl( 0, "CmpItemMenuDefault", { fg = 'NONE', bg = '#141617' } )
|
vim.api.nvim_set_hl(0, "CmpItemMenuDefault", { fg = 'NONE', bg = '#141617' })
|
||||||
vim.api.nvim_set_hl( 0, "CmpItemKindFunction", { fg = '#d3869b', bg = 'NONE', italic = true } )
|
vim.api.nvim_set_hl(0, "CmpItemKindFunction", { fg = '#d3869b', bg = 'NONE', italic = true })
|
||||||
vim.api.nvim_set_hl( 0, "CmpItemKindSnippet", { fg = '#d8a657', bg = 'NONE', italic = true } )
|
vim.api.nvim_set_hl(0, "CmpItemKindSnippet", { fg = '#d8a657', bg = 'NONE', italic = true })
|
||||||
vim.api.nvim_set_hl( 0, "CmpItemKindText", {fg = '#ddc7a1', bg = 'NONE', italic = true } )
|
vim.api.nvim_set_hl(0, "CmpItemKindText", { fg = '#ddc7a1', bg = 'NONE', italic = true })
|
||||||
vim.api.nvim_set_hl( 0, "CmpItemKindVariable", {fg = '#7daea3', bg = 'NONE', italic = true } )
|
vim.api.nvim_set_hl(0, "CmpItemKindVariable", { fg = '#7daea3', bg = 'NONE', italic = true })
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -24,7 +24,7 @@ return {
|
||||||
{
|
{
|
||||||
"hrsh7th/nvim-cmp",
|
"hrsh7th/nvim-cmp",
|
||||||
version = false,
|
version = false,
|
||||||
event = {
|
event = {
|
||||||
-- "InsertEnter",
|
-- "InsertEnter",
|
||||||
-- "CmdlineEnter",
|
-- "CmdlineEnter",
|
||||||
"BufWinEnter",
|
"BufWinEnter",
|
||||||
|
@ -37,7 +37,7 @@ return {
|
||||||
"saadparwaiz1/cmp_luasnip",
|
"saadparwaiz1/cmp_luasnip",
|
||||||
},
|
},
|
||||||
opts = function()
|
opts = function()
|
||||||
-- Set up nvim-cmp with luasnip
|
-- Set up nvim-cmp with luasnip
|
||||||
local kind_icons = {
|
local kind_icons = {
|
||||||
Text = "",
|
Text = "",
|
||||||
Method = "",
|
Method = "",
|
||||||
|
@ -69,34 +69,34 @@ return {
|
||||||
local has_words_before = function()
|
local has_words_before = function()
|
||||||
unpack = unpack or table.unpack
|
unpack = unpack or table.unpack
|
||||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||||
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
return col ~= 0 and
|
||||||
|
vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||||
end
|
end
|
||||||
|
|
||||||
local luasnip = require("luasnip")
|
local luasnip = require("luasnip")
|
||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
|
|
||||||
return{
|
return {
|
||||||
formatting = {
|
formatting = {
|
||||||
format = function(entry, vim_item)
|
format = function(entry, vim_item)
|
||||||
-- Kind icons
|
-- Kind icons
|
||||||
vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind
|
vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind
|
||||||
-- Source
|
-- Source
|
||||||
vim_item.menu = ({
|
vim_item.menu = ({
|
||||||
-- buffer = "[Buffer]",
|
-- buffer = "[Buffer]",
|
||||||
-- nvim_lsp = "[LSP]",
|
-- nvim_lsp = "[LSP]",
|
||||||
-- luasnip = "[LuaSnip]",
|
-- luasnip = "[LuaSnip]",
|
||||||
-- nvim_lua = "[Lua]",
|
-- nvim_lua = "[Lua]",
|
||||||
-- latex_symbols = "[LaTeX]",
|
-- latex_symbols = "[LaTeX]",
|
||||||
buffer = "",
|
buffer = "",
|
||||||
nvim_lsp = "",
|
nvim_lsp = "",
|
||||||
luasnip = "",
|
luasnip = "",
|
||||||
nvim_lua = "",
|
nvim_lua = "",
|
||||||
latex_symbols = "",
|
latex_symbols = "",
|
||||||
})[entry.source.name]
|
})[entry.source.name]
|
||||||
return vim_item
|
return vim_item
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
|
||||||
snippet = {
|
snippet = {
|
||||||
-- REQUIRED - you must specify a snippet engine
|
-- REQUIRED - you must specify a snippet engine
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
|
@ -106,90 +106,85 @@ return {
|
||||||
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
|
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- completion = {
|
-- completion = {
|
||||||
-- autocomplete = false,
|
-- autocomplete = false,
|
||||||
-- },
|
-- },
|
||||||
|
|
||||||
window = {
|
window = {
|
||||||
completion = cmp.config.window.bordered(),
|
completion = cmp.config.window.bordered(),
|
||||||
documentation = cmp.config.window.bordered(),
|
documentation = cmp.config.window.bordered(),
|
||||||
},
|
},
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
['<C-b>'] = cmp.mapping.scroll_docs( -4),
|
||||||
|
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||||
|
-- ['<C-Space>'] = cmp.mapping.complete(),
|
||||||
|
-- ['<C-e>'] = cmp.mapping.abort(),
|
||||||
|
['<C-e>'] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.abort()
|
||||||
|
else
|
||||||
|
cmp.complete()
|
||||||
|
end
|
||||||
|
end),
|
||||||
|
['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||||
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item()
|
||||||
|
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
|
||||||
|
-- they way you will only jump inside the snippet region
|
||||||
|
elseif luasnip.expand_or_jumpable() then
|
||||||
|
luasnip.expand_or_jump()
|
||||||
|
elseif has_words_before() then
|
||||||
|
cmp.complete()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
|
||||||
mapping = cmp.mapping.preset.insert({
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
if cmp.visible() then
|
||||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
cmp.select_prev_item()
|
||||||
-- ['<C-Space>'] = cmp.mapping.complete(),
|
elseif luasnip.jumpable( -1) then
|
||||||
-- ['<C-e>'] = cmp.mapping.abort(),
|
luasnip.jump( -1)
|
||||||
['<C-e>'] = cmp.mapping(function(fallback)
|
else
|
||||||
if cmp.visible() then
|
fallback()
|
||||||
cmp.abort()
|
end
|
||||||
else
|
end, { "i", "s" }),
|
||||||
cmp.complete()
|
}),
|
||||||
end
|
sources = cmp.config.sources({
|
||||||
end),
|
{ name = 'nvim_lsp' },
|
||||||
['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
-- { name = 'vsnip' }, -- For vsnip users.
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
{ name = 'luasnip' }, -- For luasnip users.
|
||||||
if cmp.visible() then
|
-- { name = 'ultisnips' }, -- For ultisnips users.
|
||||||
cmp.select_next_item()
|
-- { name = 'snippy' }, -- For snippy users.
|
||||||
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
|
{ name = 'buffer' },
|
||||||
-- they way you will only jump inside the snippet region
|
}, {
|
||||||
elseif luasnip.expand_or_jumpable() then
|
}),
|
||||||
luasnip.expand_or_jump()
|
-- Set configuration for specific filetype.
|
||||||
elseif has_words_before() then
|
cmp.setup.filetype('gitcommit', {
|
||||||
cmp.complete()
|
|
||||||
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" }),
|
|
||||||
}),
|
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
{ name = 'nvim_lsp' },
|
{ name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
|
||||||
-- { name = 'vsnip' }, -- For vsnip users.
|
|
||||||
{ name = 'luasnip' }, -- For luasnip users.
|
|
||||||
-- { name = 'ultisnips' }, -- For ultisnips users.
|
|
||||||
-- { name = 'snippy' }, -- For snippy users.
|
|
||||||
{ name = 'buffer' },
|
|
||||||
}, {
|
}, {
|
||||||
}),
|
{ name = 'buffer' },
|
||||||
|
})
|
||||||
-- Set configuration for specific filetype.
|
}),
|
||||||
cmp.setup.filetype('gitcommit', {
|
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
|
||||||
sources = cmp.config.sources({
|
cmp.setup.cmdline({ '/', '?' }, {
|
||||||
{ name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
}, {
|
sources = {
|
||||||
{ name = 'buffer' },
|
{ name = 'buffer' }
|
||||||
})
|
}
|
||||||
}),
|
}),
|
||||||
|
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||||
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
|
cmp.setup.cmdline(':', {
|
||||||
cmp.setup.cmdline({ '/', '?' }, {
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
mapping = cmp.mapping.preset.cmdline(),
|
sources = cmp.config.sources({
|
||||||
sources = {
|
{ name = 'path' }
|
||||||
{ name = 'buffer' }
|
}, {
|
||||||
}
|
{ name = 'cmdline' }
|
||||||
}),
|
})
|
||||||
|
}),
|
||||||
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
}
|
||||||
cmp.setup.cmdline(':', {
|
|
||||||
mapping = cmp.mapping.preset.cmdline(),
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = 'path' }
|
|
||||||
}, {
|
|
||||||
{ name = 'cmdline' }
|
|
||||||
})
|
|
||||||
}),
|
|
||||||
}
|
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ return {
|
||||||
update_n_lines = "gzn",
|
update_n_lines = "gzn",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
config = function (_, opts)
|
config = function(_, opts)
|
||||||
require("mini.surround").setup(opts)
|
require("mini.surround").setup(opts)
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,14 +5,14 @@ return {
|
||||||
cmd = "Telescope",
|
cmd = "Telescope",
|
||||||
version = false,
|
version = false,
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" },
|
{ "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" },
|
||||||
{ "<leader>,", "<cmd>Telescope buffers show_all_buffers=true<cr>", desc = "Switch Buffer" },
|
{ "<leader>,", "<cmd>Telescope buffers show_all_buffers=true<cr>", desc = "Switch Buffer" },
|
||||||
-- find
|
-- find
|
||||||
{"<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find Files" },
|
{ "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find Files" },
|
||||||
{"<leader>fg", "<cmd>Telescope live_grep<cr>", desc = "Grep Content in Files" },
|
{ "<leader>fg", "<cmd>Telescope live_grep<cr>", desc = "Grep Content in Files" },
|
||||||
{"<leader>/", "<cmd>Telescope live_grep<cr>", desc = "Grep Content in Files" },
|
{ "<leader>/", "<cmd>Telescope live_grep<cr>", desc = "Grep Content in Files" },
|
||||||
{"<leader>fG", "<cmd>Telescope git_files<cr>", desc = "Find Git Files" },
|
{ "<leader>fG", "<cmd>Telescope git_files<cr>", desc = "Find Git Files" },
|
||||||
{"<leader>fk", "<cmd>Telescope keymaps<cr>", desc = "Find Git Files" },
|
{ "<leader>fk", "<cmd>Telescope keymaps<cr>", desc = "Find Git Files" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,22 +5,22 @@ return {
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
-- event = "BufReadPre",
|
-- event = "BufReadPre",
|
||||||
opts = {
|
opts = {
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"c",
|
"c",
|
||||||
"lua",
|
"lua",
|
||||||
"rust",
|
"rust",
|
||||||
"latex",
|
"latex",
|
||||||
"bibtex",
|
"bibtex",
|
||||||
"python",
|
"python",
|
||||||
"vim",
|
"vim",
|
||||||
"yaml",
|
"yaml",
|
||||||
"json",
|
"json",
|
||||||
},
|
},
|
||||||
sync_install = false,
|
sync_install = false,
|
||||||
auto_install = true,
|
auto_install = true,
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
disable = {
|
disable = {
|
||||||
"markdown",
|
"markdown",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"folke/twilight.nvim",
|
"folke/twilight.nvim",
|
||||||
config = function ()
|
config = function()
|
||||||
require("twilight").setup {
|
require("twilight").setup {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue