[nvim] Massive restructure and cleanup
This commit is contained in:
parent
d39688bb61
commit
0a573540b0
28 changed files with 577 additions and 947 deletions
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "de1a287c9cb525ae52bc846e8f6207e5ef1da5ac" },
|
||||
"LuaSnip": { "branch": "master", "commit": "878ace11983444d865a72e1759dbcc331d1ace4c" },
|
||||
"blame.nvim": { "branch": "main", "commit": "dedbcdce857f708c63f261287ac7491a893912d0" },
|
||||
"catppuccin": { "branch": "main", "commit": "d97387aea8264f484bb5d5e74f2182a06c83e0d8" },
|
||||
"cinnamon.nvim": { "branch": "master", "commit": "a011e84b624cd7b609ea928237505d31b987748a" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
|
||||
|
@ -10,46 +9,36 @@
|
|||
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||
"conform.nvim": { "branch": "master", "commit": "5c9b6a6a50f3ec2c01f729dac872679fa6ea813f" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "572314728cb1ce012e825fd66331f52c94acac12" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "ef99df04a1c53a453602421bc0f756997edc8289" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "dd2fd1281d4b22e7b4a5bfafa3e142d958e251f2" },
|
||||
"fzf-lua": { "branch": "main", "commit": "a9e5755721c0f24cd1635ea4ff181df5b1bd5dd4" },
|
||||
"gruvbox-material": { "branch": "master", "commit": "aa8096277690db1e1807ec57812c2cf3d54bb37f" },
|
||||
"conform.nvim": { "branch": "master", "commit": "f3b930db4964d60e255c8f9e37b7f2218dfc08cb" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "3c38ac861e1b8d4077ff46a779cde17330b29f3a" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "d0610077b6129cf9f7f78afbe3a1425d60f6e2f1" },
|
||||
"fzf-lua": { "branch": "main", "commit": "b92220ec838c195eb1c711daa69c905b1d7b8d8c" },
|
||||
"gruvbox-material": { "branch": "master", "commit": "848b4de6ab014d689d5c20790afebd7c32c1581b" },
|
||||
"harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" },
|
||||
"instant.nvim": { "branch": "master", "commit": "294b6d08143b3db8f9db7f606829270149e1a786" },
|
||||
"jq.nvim": { "branch": "master", "commit": "b9879798f25a9318894456dc7464af0904c08958" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "8f19915175395680808de529e4220da8dafc0759" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "eab487c2520f0fe9e54eb5e3ea0606e20512492e" },
|
||||
"lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
|
||||
"ltex-extra.nvim": { "branch": "master", "commit": "4296c2c7aefbca721d02a011366a1de30598046c" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
|
||||
"ltex-extra.nvim": { "branch": "master", "commit": "3ee08af31bf826c6ae2ca2a294b79f688306c0be" },
|
||||
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "a4caa0d083aab56f6cd5acf2d42331b74614a585" },
|
||||
"mason-nvim-dap.nvim": { "branch": "main", "commit": "67210c0e775adec55de9826b038e8b62de554afc" },
|
||||
"mason.nvim": { "branch": "main", "commit": "49ff59aded1047a773670651cfa40e76e63c6377" },
|
||||
"mason.nvim": { "branch": "main", "commit": "0fb4e56837f13b81a972fcc0554be1327b39061e" },
|
||||
"mini.ai": { "branch": "main", "commit": "7859b6344f5cee567a94f173859d25e20ba1a77e" },
|
||||
"mini.notify": { "branch": "main", "commit": "2d506633f50bd61b1041aa4a6d62e0fe0e6ae09e" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "c15de7e7981f1111642e7e53799e1211d4606cb9" },
|
||||
"nvim-bqf": { "branch": "main", "commit": "7751b6ef9fbc3907478eaf23e866c4316a2ed1b4" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" },
|
||||
"nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" },
|
||||
"nvim-dap": { "branch": "master", "commit": "5a2f7121869394502521c52b2bc581ab22c69447" },
|
||||
"nvim-dap-go": { "branch": "main", "commit": "5faf165f5062187320eaf9d177c3c1f647adc22e" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "334cf3038c4756e6ab999cbac67c847fb654c190" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "eadcee1573ca9d0e0cd36a49f620186a8dfdc607" },
|
||||
"nvim-nio": { "branch": "master", "commit": "def97d9351bf423f4302b9b76fd4e9729e85086c" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "710a8fa7379db32199545f30ea01dd8446b9302f" },
|
||||
"nvim-tmux-navigation": { "branch": "main", "commit": "4898c98702954439233fdaf764c39636681e2861" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "30de5e7e9486fb1b1b8c2a1e71052b13f94f1cb0" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "b7d50e59b1b2990b3ce8761d4cf595f4b71c87e2" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "f62bfe19e0fbc13ae95649dfb3cf22f4ff85b683" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "5f9bf4b1ead7707e4e74e5319ee56bdc81fb73db" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "e37bb1feee9e7320c76050a55443fa843b4b6f83" },
|
||||
"oil.nvim": { "branch": "master", "commit": "259b1fbc84734bfb74225b2c2f408dd7ed9cf474" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "3557e41418b4a6c5b85d5d64abe94c9c50fa9b14" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "b77921fdc44833c994fdb389d658ccbce5490c16" },
|
||||
"oil.nvim": { "branch": "master", "commit": "2cb39e838e9dcd8b374f09a3a87a2e5ec9d372f6" },
|
||||
"pastify.nvim": { "branch": "main", "commit": "47317b9bb7bf5fb7dfd994a6eb9bec8f00628dc0" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
|
||||
"presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "e1549807066947818113a7d7ed48f637e49620d3" },
|
||||
"undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" },
|
||||
"vim-be-good": { "branch": "master", "commit": "4fa57b7957715c91326fcead58c1fa898b9b3625" },
|
||||
"vim-jukit": { "branch": "master", "commit": "73214c9a8abc4b6aa7a6266b5bc2ddbf8b3e3c00" },
|
||||
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
|
||||
"vim-tpipeline": { "branch": "master", "commit": "5dd3832bd6e239feccb11cadca583cdcf9d5bda1" },
|
||||
"vimtex": { "branch": "master", "commit": "9665df7f51ee24aa81dbd81782e0a22480209753" },
|
||||
"zen-mode.nvim": { "branch": "main", "commit": "78557d972b4bfbb7488e17b5703d25164ae64e6a" }
|
||||
"vimtex": { "branch": "master", "commit": "9665df7f51ee24aa81dbd81782e0a22480209753" }
|
||||
}
|
|
@ -14,4 +14,5 @@ end
|
|||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
--Call lazy config here
|
||||
require('plugins.lazy')
|
||||
local lazy = require("lazy")
|
||||
lazy.setup("plugins")
|
||||
|
|
|
@ -25,8 +25,8 @@ vim.opt.softtabstop = 4
|
|||
vim.opt.shiftwidth = 4
|
||||
vim.opt.expandtab = true
|
||||
--quickfix keybinds
|
||||
vim.keymap.set("n", "<C-k>", "<cmd>cprev<CR>zz")
|
||||
vim.keymap.set("n", "<C-j>", "<cmd>cnext<CR>zz")
|
||||
vim.keymap.set("n", "<C-p>", "<cmd>cprev<CR>zz")
|
||||
vim.keymap.set("n", "<C-n>", "<cmd>cnext<CR>zz")
|
||||
--buffer keybinds
|
||||
vim.keymap.set("n", "<A-h>", "<cmd>bp<CR>")
|
||||
vim.keymap.set("n", "<A-l>", "<cmd>bn<CR>")
|
||||
|
@ -47,3 +47,4 @@ vim.g.jukit_mappings = 0
|
|||
--Format Options
|
||||
vim.opt.formatoptions:remove("ro")
|
||||
--Sign gutter always on
|
||||
vim.opt.signcolumn = "yes"
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
local Rule = require('nvim-autopairs.rule')
|
||||
local npairs = require('nvim-autopairs')
|
||||
|
||||
npairs.setup({
|
||||
map_cr = true,
|
||||
map_bs = true,
|
||||
check_ts = true,
|
||||
enable_check_bracket_line = true,
|
||||
ignored_next_char = "[%w]"
|
||||
})
|
|
@ -1,107 +1,112 @@
|
|||
local cmp_status_ok, cmp = pcall(require, "cmp")
|
||||
if not cmp_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local snip_status_ok, luasnip = pcall(require, "luasnip")
|
||||
if not snip_status_ok then
|
||||
return
|
||||
end
|
||||
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 lspkind_status_ok, lspkind = pcall(require, "lspkind")
|
||||
if not lspkind_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body) -- For `luasnip` users.
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-u>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-d>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<C-y>"] = cmp.mapping(
|
||||
cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Insert,
|
||||
select = true,
|
||||
}),
|
||||
{ "i", "c" }
|
||||
),
|
||||
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
|
||||
["<C-l>"] = cmp.mapping(function()
|
||||
if luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
end
|
||||
end),
|
||||
["<C-h>"] = cmp.mapping(function()
|
||||
if luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
end
|
||||
end),
|
||||
},
|
||||
formatting = {
|
||||
fields = { "kind", "abbr", "menu" },
|
||||
format = lspkind.cmp_format({
|
||||
mode = "symbol_text",
|
||||
maxwidth = 50,
|
||||
ellipsis_char = "...",
|
||||
show_labelDetails = true,
|
||||
|
||||
before = function(entry, vim_item)
|
||||
vim_item.menu = ({
|
||||
nvim_lsp = "[LSP]",
|
||||
nvim_lua = "[LSP]",
|
||||
path = "[Path]",
|
||||
})[entry.source.name]
|
||||
return vim_item
|
||||
end,
|
||||
}),
|
||||
},
|
||||
preselect = cmp.PreselectMode.None,
|
||||
sorting = {
|
||||
priority_weight = 2,
|
||||
comparators = {
|
||||
cmp.config.compare.offset,
|
||||
cmp.config.compare.exact,
|
||||
cmp.config.compare.score,
|
||||
cmp.config.compare.kind,
|
||||
cmp.config.compare.recently_used,
|
||||
cmp.config.compare.locality,
|
||||
|
||||
--Make entries that start with underline appear after
|
||||
function(entry1, entry2)
|
||||
local _, entry1_under = entry1.completion_item.label:find("^_+")
|
||||
local _, entry2_under = entry2.completion_item.label:find("^_+")
|
||||
entry1_under = entry1_under or 0
|
||||
entry2_under = entry2_under or 0
|
||||
if entry1_under > entry2_under then
|
||||
return false
|
||||
elseif entry1_under < entry2_under then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
return {
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp", -- lsp
|
||||
"hrsh7th/cmp-nvim-lua", -- Nvim API completions
|
||||
"hrsh7th/cmp-nvim-lsp-signature-help", -- Show function signatures
|
||||
"hrsh7th/cmp-buffer", --buffer completions
|
||||
"hrsh7th/cmp-path", --path completions
|
||||
"hrsh7th/cmp-cmdline", --cmdline completions
|
||||
"L3MON4D3/LuaSnip",
|
||||
"rafamadriz/friendly-snippets",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"onsails/lspkind.nvim", --lspkind icons
|
||||
},
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lua" },
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "path" },
|
||||
}, {
|
||||
{ name = "buffer", keyword_length = 5 },
|
||||
}),
|
||||
})
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
|
||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||
local luasnip = require("luasnip")
|
||||
require("luasnip/loaders/from_vscode").lazy_load()
|
||||
|
||||
local lspkind = require("lspkind")
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-u>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-d>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-y>"] = cmp.mapping(
|
||||
cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Insert,
|
||||
select = true,
|
||||
}),
|
||||
{ "i", "c" }
|
||||
),
|
||||
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
|
||||
["<C-l>"] = cmp.mapping(function()
|
||||
if luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
end
|
||||
end),
|
||||
["<C-h>"] = cmp.mapping(function()
|
||||
if luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
end
|
||||
end),
|
||||
},
|
||||
formatting = {
|
||||
fields = { "kind", "abbr", "menu" },
|
||||
format = lspkind.cmp_format({
|
||||
mode = "symbol_text",
|
||||
maxwidth = 50,
|
||||
ellipsis_char = "...",
|
||||
show_labelDetails = true,
|
||||
|
||||
before = function(entry, vim_item)
|
||||
vim_item.menu = ({
|
||||
nvim_lsp = "[LSP]",
|
||||
nvim_lua = "[NVIM LSP]",
|
||||
path = "[Path]",
|
||||
})[entry.source.name]
|
||||
return vim_item
|
||||
end,
|
||||
}),
|
||||
},
|
||||
preselect = cmp.PreselectMode.None,
|
||||
sorting = {
|
||||
priority_weight = 2,
|
||||
comparators = {
|
||||
cmp.config.compare.offset,
|
||||
cmp.config.compare.exact,
|
||||
cmp.config.compare.score,
|
||||
cmp.config.compare.kind,
|
||||
cmp.config.compare.recently_used,
|
||||
cmp.config.compare.locality,
|
||||
|
||||
--Make entries that start with underline appear after
|
||||
function(entry1, entry2)
|
||||
local _, entry1_under = entry1.completion_item.label:find("^_+")
|
||||
local _, entry2_under = entry2.completion_item.label:find("^_+")
|
||||
entry1_under = entry1_under or 0
|
||||
entry2_under = entry2_under or 0
|
||||
if entry1_under > entry2_under then
|
||||
return false
|
||||
elseif entry1_under < entry2_under then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lua" },
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "path" },
|
||||
}, {
|
||||
{ name = "buffer", keyword_length = 5 },
|
||||
}),
|
||||
})
|
||||
|
||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||
end
|
||||
}
|
||||
}
|
||||
|
|
7
.config/nvim/lua/plugins/colorscheme.lua
Normal file
7
.config/nvim/lua/plugins/colorscheme.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
{
|
||||
"sainnhe/gruvbox-material",
|
||||
event = "VeryLazy",
|
||||
priority = 1000,
|
||||
},
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
require("conform").setup({
|
||||
formatters_by_ft = {
|
||||
python = { "black" },
|
||||
haskell = { "fourmolu" },
|
||||
javascript = { "prettierd" },
|
||||
markdown = { "mdformat" },
|
||||
go = { "gofmt" },
|
||||
json = {"jq"}
|
||||
}
|
||||
})
|
|
@ -1,47 +0,0 @@
|
|||
local dap = require("dap")
|
||||
|
||||
dap.adapters.lldb = {
|
||||
type = 'server',
|
||||
port = "${port}",
|
||||
executable = {
|
||||
command = '/Users/afonso/.local/share/nvim/mason/bin/codelldb',
|
||||
args = { "--port", "${port}" },
|
||||
}
|
||||
}
|
||||
dap.adapters.codelldb = {
|
||||
type = 'server',
|
||||
host = '127.0.0.1',
|
||||
port = 13000
|
||||
}
|
||||
|
||||
dap.configurations.c = {
|
||||
{
|
||||
name = "Manually start codelldb",
|
||||
type = "codelldb",
|
||||
request = "launch",
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||
end,
|
||||
args = function()
|
||||
local args = vim.fn.input('Arguments: ')
|
||||
return args ~= '' and { args } or nil
|
||||
end,
|
||||
cwd = '${workspaceFolder}',
|
||||
stopOnEntry = false,
|
||||
},
|
||||
{
|
||||
name = "Auto start codelldb",
|
||||
type = "lldb",
|
||||
request = "launch",
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||
end,
|
||||
args = function()
|
||||
local args = vim.fn.input('Arguments: ')
|
||||
return args ~= '' and { args } or nil
|
||||
end,
|
||||
cwd = '${workspaceFolder}',
|
||||
stopOnEntry = false,
|
||||
},
|
||||
|
||||
}
|
25
.config/nvim/lua/plugins/editing.lua
Normal file
25
.config/nvim/lua/plugins/editing.lua
Normal file
|
@ -0,0 +1,25 @@
|
|||
return {
|
||||
{
|
||||
"tpope/vim-surround",
|
||||
event = "VeryLazy",
|
||||
},
|
||||
{
|
||||
"mbbill/undotree",
|
||||
event = "VeryLazy",
|
||||
},
|
||||
{
|
||||
"windwp/nvim-autopairs",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
local npairs = require('nvim-autopairs')
|
||||
|
||||
npairs.setup({
|
||||
map_cr = true,
|
||||
map_bs = true,
|
||||
check_ts = true,
|
||||
enable_check_bracket_line = true,
|
||||
ignored_next_char = "[%w]"
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
|
@ -1,34 +1,42 @@
|
|||
local fzflua = require('fzf-lua')
|
||||
fzflua.register_ui_select()
|
||||
fzflua.setup({
|
||||
defaults = {
|
||||
headers = false,
|
||||
formatter = "path.filename_first",
|
||||
winopts = {
|
||||
border = "single",
|
||||
width = 0.6,
|
||||
height = 0.5,
|
||||
},
|
||||
},
|
||||
files = {
|
||||
previewer = false,
|
||||
winopts = {
|
||||
width = 0.5,
|
||||
height = 0.3,
|
||||
}
|
||||
},
|
||||
grep = {
|
||||
winopts = {
|
||||
width = 0.7,
|
||||
preview = {
|
||||
layout = "horizontal",
|
||||
horizontal = "right:40%"
|
||||
}
|
||||
},
|
||||
return {
|
||||
{
|
||||
"ibhagwan/fzf-lua",
|
||||
event = "VeryLazy",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
local fzflua = require('fzf-lua')
|
||||
fzflua.register_ui_select()
|
||||
fzflua.setup({
|
||||
defaults = {
|
||||
headers = false,
|
||||
winopts = {
|
||||
border = "single",
|
||||
width = 0.6,
|
||||
height = 0.5,
|
||||
},
|
||||
},
|
||||
files = {
|
||||
previewer = false,
|
||||
winopts = {
|
||||
width = 0.5,
|
||||
height = 0.3,
|
||||
}
|
||||
},
|
||||
grep = {
|
||||
winopts = {
|
||||
width = 0.7,
|
||||
preview = {
|
||||
layout = "horizontal",
|
||||
horizontal = "right:40%"
|
||||
}
|
||||
},
|
||||
}
|
||||
})
|
||||
vim.keymap.set('n', '<leader>ff', fzflua.files, {})
|
||||
vim.keymap.set('n', '<leader>fe', fzflua.diagnostics_workspace, {})
|
||||
vim.keymap.set('n', '<leader>fg', fzflua.live_grep, {})
|
||||
vim.keymap.set('n', '<leader>fb', fzflua.buffers, {})
|
||||
vim.keymap.set('n', '<leader>fh', fzflua.help_tags, {})
|
||||
end
|
||||
}
|
||||
})
|
||||
vim.keymap.set('n', '<leader>ff', fzflua.files, {})
|
||||
vim.keymap.set('n', '<leader>fe', fzflua.diagnostics_workspace, {})
|
||||
vim.keymap.set('n', '<leader>fg', fzflua.live_grep, {})
|
||||
vim.keymap.set('n', '<leader>fb', fzflua.buffers, {})
|
||||
vim.keymap.set('n', '<leader>fh', fzflua.help_tags, {})
|
||||
}
|
||||
|
|
9
.config/nvim/lua/plugins/git.lua
Normal file
9
.config/nvim/lua/plugins/git.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
return {
|
||||
{
|
||||
"FabijanZulj/blame.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("blame").setup()
|
||||
end
|
||||
},
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
local harpoon = require("harpoon")
|
||||
|
||||
-- REQUIRED
|
||||
harpoon:setup()
|
||||
-- REQUIRED
|
||||
|
||||
vim.keymap.set("n", "<leader>a", function() harpoon:list():add() end)
|
||||
vim.keymap.set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
|
||||
|
||||
vim.keymap.set("n", "<C-h>", function() harpoon:list():select(1) end)
|
||||
vim.keymap.set("n", "<C-j>", function() harpoon:list():select(2) end)
|
||||
vim.keymap.set("n", "<C-k>", function() harpoon:list():select(3) end)
|
||||
vim.keymap.set("n", "<C-l>", function() harpoon:list():select(4) end)
|
|
@ -1,27 +0,0 @@
|
|||
local opts = { noremap = true, silent = true, buffer = true }
|
||||
--Convert between py and ipynb
|
||||
vim.keymap.set('n', '<leader>jnp', '<cmd>call jukit#convert#notebook_convert()<CR>', opts)
|
||||
-- Create new code cell below. Argument: Whether to create code cell (0) or markdown cell (1)
|
||||
vim.keymap.set('n', '<leader>jco', '<cmd>call jukit#cells#create_below(0)<CR>', opts)
|
||||
-- Create new code cell above. Argument: Whether to create code cell (0) or markdown cell (1)
|
||||
vim.keymap.set('n', '<leader>jcO', '<cmd>call jukit#cells#create_above(0)<CR>', opts)
|
||||
|
||||
-- Create new text (markdown) cell below. Argument: Whether to create code cell (0) or markdown cell (1)
|
||||
vim.keymap.set('n', '<leader>jct', '<cmd>call jukit#cells#create_below(1)<CR>', opts)
|
||||
-- Create new text (markdown) cell above. Argument: Whether to create code cell (0) or markdown cell (1)
|
||||
vim.keymap.set('n', '<leader>jcT', '<cmd>call jukit#cells#create_above(1)<CR>', opts)
|
||||
|
||||
-- Deletes the current cell
|
||||
vim.keymap.set('n', '<leader>jcd', '<cmd>call jukit#cells#delete()<CR>', opts)
|
||||
|
||||
-- Send current section (argument: 0 indicates the current section)
|
||||
vim.keymap.set('n', '<leader>jcc', '<cmd>call jukit#send#section(0)<CR>', opts)
|
||||
|
||||
-- Send all sections up to the current section
|
||||
vim.keymap.set('n', '<leader>jcac', '<cmd>call jukit#send#until_current_section()<CR>', opts)
|
||||
|
||||
-- Send all sections
|
||||
vim.keymap.set('n', '<leader>jca', '<cmd>call jukit#send#all()<CR>', opts)
|
||||
|
||||
-- Open an output split
|
||||
vim.keymap.set('n', '<leader>jos', '<cmd>call jukit#splits#output()<CR>', opts)
|
|
@ -1,345 +0,0 @@
|
|||
local lazy = require("lazy")
|
||||
|
||||
lazy.setup({
|
||||
|
||||
-------------------------------------------THEMES------------------------------------------
|
||||
{
|
||||
"catppuccin/nvim",
|
||||
name = "catppuccin",
|
||||
event = "VeryLazy",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
opts = {},
|
||||
},
|
||||
|
||||
{
|
||||
"sainnhe/gruvbox-material",
|
||||
event = "VeryLazy",
|
||||
priority = 1000,
|
||||
},
|
||||
|
||||
-------------------------------------------------------QOL---------------------------------
|
||||
|
||||
{
|
||||
"jbyuki/instant.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
vim.g.instant_username = "afonso"
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
event = "VeryLazy",
|
||||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
||||
ft = { "markdown" },
|
||||
build = function() vim.fn["mkdp#util#install"]() end,
|
||||
},
|
||||
|
||||
{
|
||||
"ThePrimeagen/harpoon",
|
||||
event = "VeryLazy",
|
||||
branch = "harpoon2",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
require("plugins.harpoon")
|
||||
end
|
||||
},
|
||||
|
||||
{
|
||||
"vimpostor/vim-tpipeline",
|
||||
config = function()
|
||||
vim.g.tpipeline_restore = 1
|
||||
end
|
||||
},
|
||||
|
||||
{
|
||||
"FabijanZulj/blame.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("blame").setup()
|
||||
end
|
||||
},
|
||||
|
||||
{
|
||||
"TobinPalmer/pastify.nvim",
|
||||
event = "VeryLazy",
|
||||
cmd = { "Pastify" },
|
||||
opts = {},
|
||||
},
|
||||
|
||||
--Python notebooks
|
||||
{
|
||||
"luk400/vim-jukit",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("plugins.jukit")
|
||||
end,
|
||||
ft = { "python", "json" },
|
||||
},
|
||||
|
||||
--Nvim to browser
|
||||
--"subnut/nvim-ghost.nvim",
|
||||
|
||||
{
|
||||
"declancm/cinnamon.nvim",
|
||||
opts = {
|
||||
scroll_limit = 10000,
|
||||
always_scroll = true,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"folke/todo-comments.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
opts = {
|
||||
vim.keymap.set("n", "]t", function()
|
||||
require("todo-comments").jump_next()
|
||||
end, { desc = "Next todo comment" }),
|
||||
|
||||
vim.keymap.set("n", "[t", function()
|
||||
require("todo-comments").jump_prev()
|
||||
end, { desc = "Previous todo comment" })
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"folke/zen-mode.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
vim.keymap.set("n", "<leader>z", "<Cmd> ZenMode <CR>", { noremap = true, silent = true }),
|
||||
},
|
||||
},
|
||||
|
||||
--Change add and remove surroundings from words
|
||||
"tpope/vim-surround",
|
||||
|
||||
{
|
||||
"NvChad/nvim-colorizer.lua",
|
||||
opts = {},
|
||||
},
|
||||
|
||||
"mbbill/undotree",
|
||||
|
||||
--Tmux navigation
|
||||
{
|
||||
"alexghergh/nvim-tmux-navigation",
|
||||
opts = {
|
||||
disable_when_zoomed = true, -- defaults to false
|
||||
keybindings = {
|
||||
left = "<F5>",
|
||||
down = "<F6>",
|
||||
up = "<F7>",
|
||||
right = "<F8>",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Rename variable pop up
|
||||
{
|
||||
"stevearc/dressing.nvim",
|
||||
event = "VeryLazy",
|
||||
},
|
||||
|
||||
{
|
||||
"windwp/nvim-autopairs",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("plugins.autopairs")
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons", opt = true },
|
||||
config = function()
|
||||
require("plugins.lualine")
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"stevearc/oil.nvim",
|
||||
opts = {},
|
||||
},
|
||||
|
||||
-------------------------------------------------------LSP----------------------------------------------
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp", -- lsp
|
||||
"hrsh7th/cmp-nvim-lua", -- Nvim API completions
|
||||
"hrsh7th/cmp-nvim-lsp-signature-help", -- Show function signatures
|
||||
"hrsh7th/cmp-buffer", --buffer completions
|
||||
"hrsh7th/cmp-path", --path completions
|
||||
"hrsh7th/cmp-cmdline", --cmdline completions
|
||||
"L3MON4D3/LuaSnip",
|
||||
"rafamadriz/friendly-snippets",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"onsails/lspkind.nvim", --lspkind icons
|
||||
},
|
||||
config = function()
|
||||
require("plugins.cmp")
|
||||
end,
|
||||
},
|
||||
|
||||
--LSP Status
|
||||
"j-hui/fidget.nvim",
|
||||
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
event = "VeryLazy",
|
||||
dependencies = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" },
|
||||
config = function()
|
||||
local dap = require("dap")
|
||||
local dapui = require("dapui")
|
||||
dapui.setup()
|
||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||
dapui.close()
|
||||
end
|
||||
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||
dapui.close()
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"jay-babu/mason-nvim-dap.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"mfussenegger/nvim-dap",
|
||||
},
|
||||
opts = {
|
||||
handlers = {},
|
||||
},
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("plugins.dap")
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
'leoluz/nvim-dap-go',
|
||||
event = "VeryLazy",
|
||||
opts = {}
|
||||
},
|
||||
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
dependencies = {
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
dependencies = {
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
config = function()
|
||||
require("plugins.mason")
|
||||
end,
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require("plugins.mason-lspconfig")
|
||||
end
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require("plugins.lspconfig")
|
||||
end,
|
||||
},
|
||||
|
||||
--Better quick fix
|
||||
{
|
||||
'kevinhwang91/nvim-bqf',
|
||||
event = "VeryLazy",
|
||||
ft = 'qf'
|
||||
},
|
||||
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("plugins.conform")
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"lervag/vimtex",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("plugins.vimtex")
|
||||
end,
|
||||
},
|
||||
|
||||
--'tpope/vim-commentary',
|
||||
|
||||
-- {
|
||||
-- "mrcjkb/rustaceanvim",
|
||||
-- version = "^4", -- Recommended
|
||||
-- ft = { "rust" },
|
||||
-- },
|
||||
|
||||
{
|
||||
"barreiroleo/ltex-extra.nvim",
|
||||
event = "VeryLazy",
|
||||
},
|
||||
|
||||
-------------------------------------------------------------------------------------------
|
||||
-- Syntax Highlighting
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter-textobjects'
|
||||
},
|
||||
config = function()
|
||||
require("plugins.treesitter")
|
||||
end,
|
||||
},
|
||||
|
||||
|
||||
--Sticky headers
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-context",
|
||||
config = function()
|
||||
require("plugins.treesitter-context")
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"ibhagwan/fzf-lua",
|
||||
event = "VeryLazy",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
require('plugins.fzf-lua')
|
||||
end
|
||||
},
|
||||
|
||||
--Discord Rich Presence
|
||||
"andweeb/presence.nvim",
|
||||
|
||||
--Vim be good
|
||||
{
|
||||
'ThePrimeagen/vim-be-good',
|
||||
event = "VeryLazy",
|
||||
},
|
||||
|
||||
|
||||
--JQ
|
||||
{
|
||||
'jrop/jq.nvim',
|
||||
event = "VeryLazy",
|
||||
},
|
||||
|
||||
-- {
|
||||
-- 'BooleanCube/keylab.nvim',
|
||||
-- opts = {}
|
||||
-- }
|
||||
})
|
222
.config/nvim/lua/plugins/lsp.lua
Normal file
222
.config/nvim/lua/plugins/lsp.lua
Normal file
|
@ -0,0 +1,222 @@
|
|||
return {
|
||||
-- Rename variable pop up
|
||||
{
|
||||
"stevearc/dressing.nvim",
|
||||
event = "VeryLazy",
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
config = function()
|
||||
local mason = require("mason")
|
||||
vim.api.nvim_create_augroup("_mason", { clear = true })
|
||||
local options = {
|
||||
PATH = "skip",
|
||||
ui = {
|
||||
icons = {
|
||||
package_pending = " ",
|
||||
package_installed = " ",
|
||||
package_uninstalled = " ",
|
||||
},
|
||||
keymaps = {
|
||||
toggle_server_expand = "<CR>",
|
||||
install_server = "i",
|
||||
update_server = "u",
|
||||
check_server_version = "c",
|
||||
update_all_servers = "U",
|
||||
check_outdated_servers = "C",
|
||||
uninstall_server = "X",
|
||||
cancel_installation = "<C-c>",
|
||||
},
|
||||
},
|
||||
max_concurrent_installers = 10,
|
||||
}
|
||||
mason.setup(options)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim"
|
||||
},
|
||||
config = function()
|
||||
local mason_lspconfig = require("mason-lspconfig")
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
mason_lspconfig.setup({
|
||||
automatic_installation = false,
|
||||
})
|
||||
|
||||
local lsp_defaults = lspconfig.util.default_config
|
||||
local capabilities =
|
||||
vim.tbl_deep_extend("force", lsp_defaults.capabilities, require("cmp_nvim_lsp").default_capabilities())
|
||||
|
||||
mason_lspconfig.setup_handlers({
|
||||
-- This is a default handler that will be called for each installed server (also for new servers that are installed during a session)
|
||||
function(server_name)
|
||||
lspconfig[server_name].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
end,
|
||||
["gopls"] = function()
|
||||
lspconfig["gopls"].setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
gopls = {
|
||||
["ui.completion.usePlaceholders"] = true,
|
||||
["ui.diagnostic.staticcheck"] = true,
|
||||
["ui.inlayhint.hints"] = {
|
||||
assignVariablesTypes = true,
|
||||
compositeLiteralFields = true,
|
||||
compositeLiteralTypes = true,
|
||||
constantValues = true,
|
||||
functionTypeParameters = true,
|
||||
parameterNames = true,
|
||||
rangeVariableTypes = true
|
||||
},
|
||||
}
|
||||
}
|
||||
})
|
||||
end,
|
||||
["lua_ls"] = function()
|
||||
lspconfig["lua_ls"].setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
version = "LuaJIT",
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
-- Make the server aware of Neovim runtime files
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
},
|
||||
hint = { enable = true }
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
["ltex"] = function()
|
||||
lspconfig["ltex"].setup({
|
||||
capabilities = capabilities,
|
||||
--Local on attach
|
||||
on_attach = function(_, _)
|
||||
-- rest of your on_attach process.
|
||||
require("ltex_extra").setup()
|
||||
end,
|
||||
settings = {
|
||||
ltex = {
|
||||
language = "pt-PT",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
["basedpyright"] = function()
|
||||
lspconfig["basedpyright"].setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
verboseOutput = true,
|
||||
autoImportCompletion = true,
|
||||
basedpyright = {
|
||||
analysis = {
|
||||
typeCheckingMode = "all",
|
||||
autoSearchPaths = true,
|
||||
useLibraryCodeForTypes = true,
|
||||
diagnosticMode = "openFilesOnly",
|
||||
indexing = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
})
|
||||
end
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
dependencies = {
|
||||
"williamboman/mason-lspconfig.nvim"
|
||||
},
|
||||
config = function()
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
-- Use an on_attach function to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
|
||||
callback = function(ev)
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc"
|
||||
|
||||
local fzflua = require("fzf-lua")
|
||||
local conform = require("conform")
|
||||
|
||||
local client = vim.lsp.get_client_by_id(ev.data.client_id)
|
||||
if client ~= nil then
|
||||
client.server_capabilities.semanticTokensProvider = nil
|
||||
end
|
||||
|
||||
-- Mappings.
|
||||
local bufopts = { noremap = true, silent = true, buffer = ev.buf }
|
||||
vim.keymap.set("n", "<space>e", vim.diagnostic.open_float, bufopts)
|
||||
vim.keymap.set("n", "<space>q", vim.diagnostic.setloclist, bufopts)
|
||||
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, bufopts)
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, bufopts)
|
||||
vim.keymap.set("n", "gr", fzflua.lsp_references, bufopts)
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, bufopts)
|
||||
vim.keymap.set("n", "gi", fzflua.lsp_implementations, bufopts)
|
||||
vim.keymap.set("n", "<space>k", vim.lsp.buf.signature_help, bufopts)
|
||||
vim.keymap.set("n", "<space>D", vim.lsp.buf.type_definition, bufopts)
|
||||
vim.keymap.set("n", "<space>rn", vim.lsp.buf.rename, bufopts)
|
||||
vim.keymap.set("n", "<space>ca", vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set("n", "<space>ge", vim.diagnostic.goto_next, bufopts)
|
||||
vim.keymap.set("n", "<space>gE", vim.diagnostic.goto_prev, bufopts)
|
||||
vim.keymap.set("n", "<space>fo", function() conform.format({ lsp_fallback = true }) end, bufopts)
|
||||
end,
|
||||
})
|
||||
|
||||
-- ADD NVIM CMP AS A CAPABILITY
|
||||
local lsp_defaults = lspconfig.util.default_config
|
||||
local capabilities =
|
||||
vim.tbl_deep_extend("force", lsp_defaults.capabilities, require("cmp_nvim_lsp").default_capabilities())
|
||||
|
||||
lspconfig["hls"].setup({
|
||||
capabilities = capabilities,
|
||||
filetypes = { 'haskell', 'lhaskell', 'cabal' },
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("conform").setup({
|
||||
formatters_by_ft = {
|
||||
python = { "black" },
|
||||
haskell = { "fourmolu" },
|
||||
javascript = { "prettierd" },
|
||||
markdown = { "mdformat" },
|
||||
go = { "gofmt" },
|
||||
json = { "jq" }
|
||||
}
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"lervag/vimtex",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
vim.g.vimtex_view_method = 'skim'
|
||||
vim.g.vimtex_compiler_methor = 'pdflatex'
|
||||
end,
|
||||
},
|
||||
{
|
||||
"barreiroleo/ltex-extra.nvim",
|
||||
event = "VeryLazy",
|
||||
},
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
local lspconfig = require("lspconfig")
|
||||
|
||||
-- Use an on_attach function to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
|
||||
callback = function(ev)
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc"
|
||||
vim.opt_local.signcolumn = numbers
|
||||
|
||||
local fzflua = require("fzf-lua")
|
||||
local conform = require("conform")
|
||||
|
||||
local client = vim.lsp.get_client_by_id(ev.data.client_id)
|
||||
client.server_capabilities.semanticTokensProvider = nil
|
||||
|
||||
-- Mappings.
|
||||
local bufopts = { noremap = true, silent = true, buffer = ev.buf }
|
||||
vim.keymap.set("n", "<space>e", vim.diagnostic.open_float, bufopts)
|
||||
vim.keymap.set("n", "<space>q", vim.diagnostic.setloclist, bufopts)
|
||||
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, bufopts)
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, bufopts)
|
||||
vim.keymap.set("n", "gr", fzflua.lsp_references, bufopts)
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, bufopts)
|
||||
vim.keymap.set("n", "gi", fzflua.lsp_implementations, bufopts)
|
||||
vim.keymap.set("n", "<space>k", vim.lsp.buf.signature_help, bufopts)
|
||||
vim.keymap.set("n", "<space>D", vim.lsp.buf.type_definition, bufopts)
|
||||
vim.keymap.set("n", "<space>rn", vim.lsp.buf.rename, bufopts)
|
||||
vim.keymap.set("n", "<space>ca", vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set("n", "<space>ge", vim.diagnostic.goto_next, bufopts)
|
||||
vim.keymap.set("n", "<space>gE", vim.diagnostic.goto_prev, bufopts)
|
||||
vim.keymap.set("n", "<space>fo", function() conform.format({ lsp_fallback = true }) end, bufopts)
|
||||
end,
|
||||
})
|
||||
|
||||
-- ADD NVIM CMP AS A CAPABILITY
|
||||
local lsp_defaults = lspconfig.util.default_config
|
||||
local capabilities =
|
||||
vim.tbl_deep_extend("force", lsp_defaults.capabilities, require("cmp_nvim_lsp").default_capabilities())
|
||||
|
||||
lspconfig["hls"].setup({
|
||||
capabilities = capabilities,
|
||||
filetypes = { 'haskell', 'lhaskell', 'cabal' },
|
||||
})
|
|
@ -1,40 +0,0 @@
|
|||
require('lualine').setup {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'auto',
|
||||
component_separators = { left = '', right = ''},
|
||||
section_separators = { left = '', right = ''},
|
||||
disabled_filetypes = {
|
||||
statusline = {},
|
||||
winbar = {},
|
||||
},
|
||||
ignore_focus = {},
|
||||
always_divide_middle = true,
|
||||
globalstatus = false,
|
||||
refresh = {
|
||||
statusline = 1000,
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
}
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {},
|
||||
lualine_x = {'filetype'},
|
||||
lualine_y = {},
|
||||
lualine_z = {'location'}
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {'location'},
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {},
|
||||
inactive_winbar = {},
|
||||
extensions = {}
|
||||
}
|
|
@ -1,94 +0,0 @@
|
|||
local mason_lspconfig = require("mason-lspconfig")
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
mason_lspconfig.setup({
|
||||
automatic_installation = false,
|
||||
})
|
||||
|
||||
local lsp_defaults = lspconfig.util.default_config
|
||||
local capabilities =
|
||||
vim.tbl_deep_extend("force", lsp_defaults.capabilities, require("cmp_nvim_lsp").default_capabilities())
|
||||
|
||||
mason_lspconfig.setup_handlers({
|
||||
-- This is a default handler that will be called for each installed server (also for new servers that are installed during a session)
|
||||
function(server_name)
|
||||
lspconfig[server_name].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
end,
|
||||
["gopls"] = function()
|
||||
lspconfig["gopls"].setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
gopls = {
|
||||
["ui.completion.usePlaceholders"] = true,
|
||||
["ui.diagnostic.staticcheck"] = true,
|
||||
["ui.inlayhint.hints"] = {
|
||||
assignVariablesTypes = true,
|
||||
compositeLiteralFields = true,
|
||||
compositeLiteralTypes = true,
|
||||
constantValues = true,
|
||||
functionTypeParameters = true,
|
||||
parameterNames = true,
|
||||
rangeVariableTypes = true
|
||||
},
|
||||
}
|
||||
}
|
||||
})
|
||||
end,
|
||||
["lua_ls"] = function()
|
||||
lspconfig["lua_ls"].setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
version = "LuaJIT",
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
-- Make the server aware of Neovim runtime files
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
},
|
||||
hint = { enable = true }
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
["ltex"] = function()
|
||||
lspconfig["ltex"].setup({
|
||||
capabilities = capabilities,
|
||||
--Local on attach
|
||||
on_attach = function(_, _)
|
||||
-- rest of your on_attach process.
|
||||
require("ltex_extra").setup()
|
||||
end,
|
||||
settings = {
|
||||
ltex = {
|
||||
language = "en-US",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
["basedpyright"] = function()
|
||||
lspconfig["basedpyright"].setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
verboseOutput = true,
|
||||
autoImportCompletion = true,
|
||||
basedpyright = {
|
||||
analysis = {
|
||||
typeCheckingMode = "all",
|
||||
autoSearchPaths = true,
|
||||
useLibraryCodeForTypes = true,
|
||||
diagnosticMode = "openFilesOnly",
|
||||
indexing = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
})
|
|
@ -1,24 +0,0 @@
|
|||
local mason = require("mason")
|
||||
vim.api.nvim_create_augroup("_mason", { clear = true })
|
||||
local options = {
|
||||
PATH = "skip",
|
||||
ui = {
|
||||
icons = {
|
||||
package_pending = " ",
|
||||
package_installed = " ",
|
||||
package_uninstalled = " ",
|
||||
},
|
||||
keymaps = {
|
||||
toggle_server_expand = "<CR>",
|
||||
install_server = "i",
|
||||
update_server = "u",
|
||||
check_server_version = "c",
|
||||
update_all_servers = "U",
|
||||
check_outdated_servers = "C",
|
||||
uninstall_server = "X",
|
||||
cancel_installation = "<C-c>",
|
||||
},
|
||||
},
|
||||
max_concurrent_installers = 10,
|
||||
}
|
||||
mason.setup(options)
|
29
.config/nvim/lua/plugins/misc.lua
Normal file
29
.config/nvim/lua/plugins/misc.lua
Normal file
|
@ -0,0 +1,29 @@
|
|||
return {
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
event = "VeryLazy",
|
||||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
||||
ft = { "markdown" },
|
||||
build = function() vim.fn["mkdp#util#install"]() end,
|
||||
},
|
||||
{
|
||||
"folke/todo-comments.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
opts = {
|
||||
vim.keymap.set("n", "]t", function()
|
||||
require("todo-comments").jump_next()
|
||||
end, { desc = "Next todo comment" }),
|
||||
|
||||
vim.keymap.set("n", "[t", function()
|
||||
require("todo-comments").jump_prev()
|
||||
end, { desc = "Previous todo comment" })
|
||||
},
|
||||
},
|
||||
{
|
||||
"TobinPalmer/pastify.nvim",
|
||||
event = "VeryLazy",
|
||||
cmd = { "Pastify" },
|
||||
opts = {},
|
||||
},
|
||||
}
|
44
.config/nvim/lua/plugins/navigation.lua
Normal file
44
.config/nvim/lua/plugins/navigation.lua
Normal file
|
@ -0,0 +1,44 @@
|
|||
return {
|
||||
{
|
||||
"ThePrimeagen/harpoon",
|
||||
event = "VeryLazy",
|
||||
branch = "harpoon2",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
local harpoon = require("harpoon")
|
||||
harpoon.setup()
|
||||
vim.keymap.set("n", "<leader>a", function() harpoon:list():add() end)
|
||||
vim.keymap.set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
|
||||
|
||||
vim.keymap.set("n", "<C-h>", function() harpoon:list():select(1) end)
|
||||
vim.keymap.set("n", "<C-j>", function() harpoon:list():select(2) end)
|
||||
vim.keymap.set("n", "<C-k>", function() harpoon:list():select(3) end)
|
||||
vim.keymap.set("n", "<C-l>", function() harpoon:list():select(4) end)
|
||||
end
|
||||
},
|
||||
{
|
||||
"stevearc/oil.nvim",
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"alexghergh/nvim-tmux-navigation",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
disable_when_zoomed = true, -- defaults to false
|
||||
keybindings = {
|
||||
left = "<F5>",
|
||||
down = "<F6>",
|
||||
up = "<F7>",
|
||||
right = "<F8>",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"declancm/cinnamon.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
scroll_limit = 10000,
|
||||
always_scroll = true,
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
local augroup = vim.api.nvim_create_augroup("LspFormatting",{})
|
||||
local null_ls = require("null-ls")
|
||||
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
null_ls.builtins.formatting.black,
|
||||
null_ls.builtins.formatting.gofmt,
|
||||
null_ls.builtins.formatting.prettierd.with({
|
||||
filetypes = { "html", "json", "css", "js", "yaml", "markdown" },
|
||||
}),
|
||||
null_ls.builtins.diagnostics.golangci_lint,
|
||||
},
|
||||
on_attach = function(client,bufnr)
|
||||
if client.supports_method("textDocument/formatting") then
|
||||
vim.api.nvim_clear_autocmds({
|
||||
group = augroup,
|
||||
buffer = bufnr,
|
||||
})
|
||||
vim.api.nvim_create_autocmd("BufWritePre",{
|
||||
group = augroup,
|
||||
buffer = bufnr,
|
||||
callback = function()
|
||||
vim.lsp.buf.format({ bufnr = bufnr })
|
||||
end
|
||||
})
|
||||
end
|
||||
end,
|
||||
})
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"keywordCase": "upper"
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
local telescope = require('telescope')
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
telescope.setup {
|
||||
defaults = {
|
||||
layout_strategy = "horizontal",
|
||||
path_display = { "filename_first" },
|
||||
mappings = {
|
||||
i = {
|
||||
["<esc>"] = actions.close,
|
||||
},
|
||||
},
|
||||
},
|
||||
pickers = {
|
||||
find_files = {
|
||||
previewer = false,
|
||||
layout_strategy = "center",
|
||||
layout_config = {
|
||||
height = 0.7,
|
||||
width = 0.5
|
||||
},
|
||||
},
|
||||
live_grep = {
|
||||
only_sort_text = true,
|
||||
previewer = true,
|
||||
}
|
||||
},
|
||||
extensions = {
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_cursor {}
|
||||
}
|
||||
}
|
||||
}
|
||||
telescope.load_extension('fzf')
|
||||
telescope.load_extension("ui-select")
|
||||
--local builtin = require('telescope.builtin')
|
||||
--vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
|
||||
--vim.keymap.set('n', '<leader>fe', builtin.diagnostics, {})
|
||||
--vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
|
||||
--vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
|
||||
--vim.keymap.set('n', '<leader>fs', builtin.treesitter, {})
|
||||
--vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
|
|
@ -1,8 +0,0 @@
|
|||
require'treesitter-context'.setup{
|
||||
patterns = {
|
||||
rust = {
|
||||
'impl_item',
|
||||
'match',
|
||||
},
|
||||
}
|
||||
}
|
|
@ -1,42 +1,44 @@
|
|||
local present, treesitter = pcall(require, "nvim-treesitter.configs")
|
||||
if not present then
|
||||
return
|
||||
end
|
||||
return {
|
||||
|
||||
require('nvim-treesitter.install').update({ with_sync = true })
|
||||
|
||||
|
||||
local options = {
|
||||
ensure_installed = { "c", "lua", "haskell", "rust", "markdown", "org" },
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
use_languagetree = true,
|
||||
additional_vim_regex_highlighting = { "org" },
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
-- Automatically jump forward to textobj, similar to targets.vim
|
||||
lookahead = true,
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ab"] = "@block.outer",
|
||||
["ib"] = "@block.inner",
|
||||
},
|
||||
selection_modes = {
|
||||
['@block.outer'] = 'v', -- charwise
|
||||
['@block.inner'] = 'v', -- charwise
|
||||
['@function.outer'] = 'V', -- linewise
|
||||
},
|
||||
include_surrounding_whitespace = true,
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter-textobjects'
|
||||
},
|
||||
config = function()
|
||||
local treesitter = require("nvim-treesitter.configs")
|
||||
|
||||
require('nvim-treesitter.install').update({ with_sync = true })
|
||||
|
||||
|
||||
local options = {
|
||||
ensure_installed = { "c", "lua", "haskell", "markdown" },
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
use_languagetree = true,
|
||||
additional_vim_regex_highlighting = { "org" },
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
}
|
||||
|
||||
treesitter.setup(options)
|
||||
end
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-context",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require 'treesitter-context'.setup()
|
||||
end,
|
||||
},
|
||||
{
|
||||
'echasnovski/mini.ai',
|
||||
event = "VeryLazy",
|
||||
version = false,
|
||||
opts = {}
|
||||
},
|
||||
}
|
||||
|
||||
treesitter.setup(options)
|
||||
|
|
26
.config/nvim/lua/plugins/ui.lua
Normal file
26
.config/nvim/lua/plugins/ui.lua
Normal file
|
@ -0,0 +1,26 @@
|
|||
return {
|
||||
{
|
||||
"vimpostor/vim-tpipeline",
|
||||
config = function()
|
||||
vim.g.tpipeline_restore = 1
|
||||
vim.g.tpipeline_autoembed = 1
|
||||
vim.o.laststatus = 0
|
||||
vim.g.tpipeline_statusline = '%=%l:%c'
|
||||
end
|
||||
},
|
||||
{
|
||||
'echasnovski/mini.notify',
|
||||
version = false,
|
||||
config = function()
|
||||
vim.api.nvim_set_hl(0, 'MiniNotifyNormal', { link = 'Normal' })
|
||||
vim.api.nvim_set_hl(0, 'MiniNotifyBorder', { link = 'Normal' })
|
||||
require("mini.notify").setup()
|
||||
end
|
||||
},
|
||||
--Better quick fix
|
||||
{
|
||||
'kevinhwang91/nvim-bqf',
|
||||
event = "VeryLazy",
|
||||
ft = 'qf'
|
||||
},
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
vim.g.vimtex_view_method = 'skim'
|
||||
vim.g.vimtex_compiler_methor = 'pdflatex'
|
Loading…
Reference in a new issue