mirror of
https://github.com/mikkelsvartveit/dotfiles.git
synced 2025-12-22 19:22:38 +00:00
Run formatter on plugins.lua
This commit is contained in:
parent
a8057cb6a9
commit
261ae0f781
1 changed files with 293 additions and 290 deletions
|
|
@ -20,24 +20,24 @@ require("lazy").setup({
|
||||||
name = "catppuccin",
|
name = "catppuccin",
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
config = function(plugin)
|
config = function(plugin)
|
||||||
vim.cmd.colorscheme "catppuccin-macchiato"
|
vim.cmd.colorscheme("catppuccin-macchiato")
|
||||||
end
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Treesitter config
|
-- Treesitter config
|
||||||
{
|
{
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
branch = 'master',
|
branch = "master",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
config = function()
|
config = function()
|
||||||
require("nvim-treesitter.configs").setup {
|
require("nvim-treesitter.configs").setup({
|
||||||
auto_install = true,
|
auto_install = true,
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
additional_vim_regex_highlighting = false,
|
additional_vim_regex_highlighting = false,
|
||||||
},
|
},
|
||||||
}
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -47,16 +47,19 @@ require("lazy").setup({
|
||||||
dependencies = {
|
dependencies = {
|
||||||
-- Mason for easy LSP installation
|
-- Mason for easy LSP installation
|
||||||
{ "mason-org/mason.nvim", opts = {} },
|
{ "mason-org/mason.nvim", opts = {} },
|
||||||
{ "mason-org/mason-lspconfig.nvim", opts = {
|
{
|
||||||
|
"mason-org/mason-lspconfig.nvim",
|
||||||
|
opts = {
|
||||||
handlers = {
|
handlers = {
|
||||||
-- Make it play with nvim-cmp
|
-- Make it play with nvim-cmp
|
||||||
function(server_name)
|
function(server_name)
|
||||||
require("lspconfig")[server_name].setup({
|
require("lspconfig")[server_name].setup({
|
||||||
capabilities = require('cmp_nvim_lsp').default_capabilities()
|
capabilities = require("cmp_nvim_lsp").default_capabilities(),
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
} },
|
},
|
||||||
|
},
|
||||||
|
|
||||||
-- Autocompletion (nvim-cmp)
|
-- Autocompletion (nvim-cmp)
|
||||||
"hrsh7th/nvim-cmp",
|
"hrsh7th/nvim-cmp",
|
||||||
|
|
@ -65,32 +68,32 @@ require("lazy").setup({
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
-- Setup nvim-cmp
|
-- Setup nvim-cmp
|
||||||
local cmp = require('cmp')
|
local cmp = require("cmp")
|
||||||
cmp.setup({
|
cmp.setup({
|
||||||
sources = {
|
sources = {
|
||||||
{name = 'nvim_lsp'},
|
{ name = "nvim_lsp" },
|
||||||
},
|
},
|
||||||
mapping = cmp.mapping.preset.insert({
|
mapping = cmp.mapping.preset.insert({
|
||||||
-- Enter key confirms completion item
|
-- Enter key confirms completion item
|
||||||
['<CR>'] = cmp.mapping.confirm({select = true}),
|
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||||
|
|
||||||
-- Ctrl + space triggers completion menu
|
-- Ctrl + space triggers completion menu
|
||||||
['<C-Space>'] = cmp.mapping.complete(),
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
}),
|
}),
|
||||||
snippet = {
|
snippet = {
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
require('luasnip').lsp_expand(args.body)
|
require("luasnip").lsp_expand(args.body)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Keymaps
|
-- Keymaps
|
||||||
vim.api.nvim_create_autocmd('LspAttach', {
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
callback = function(event)
|
callback = function(event)
|
||||||
local opts = { buffer = event.buf }
|
local opts = { buffer = event.buf }
|
||||||
|
|
||||||
vim.keymap.set("n", "gd", '<cmd>lua vim.lsp.buf.definition()<cr>', opts)
|
vim.keymap.set("n", "gd", "<cmd>lua vim.lsp.buf.definition()<cr>", opts)
|
||||||
vim.keymap.set("n", "gh", '<cmd>lua vim.diagnostic.open_float()<cr>', opts)
|
vim.keymap.set("n", "gh", "<cmd>lua vim.diagnostic.open_float()<cr>", opts)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
|
@ -120,7 +123,7 @@ require("lazy").setup({
|
||||||
async = false,
|
async = false,
|
||||||
filter = function(client)
|
filter = function(client)
|
||||||
return client.name == "null-ls"
|
return client.name == "null-ls"
|
||||||
end
|
end,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
@ -146,7 +149,7 @@ require("lazy").setup({
|
||||||
|
|
||||||
-- Auto-match brackets, quotes etc.
|
-- Auto-match brackets, quotes etc.
|
||||||
{
|
{
|
||||||
'windwp/nvim-autopairs',
|
"windwp/nvim-autopairs",
|
||||||
event = "InsertEnter",
|
event = "InsertEnter",
|
||||||
opts = {},
|
opts = {},
|
||||||
},
|
},
|
||||||
|
|
@ -242,8 +245,8 @@ require("lazy").setup({
|
||||||
"--column",
|
"--column",
|
||||||
"--smart-case",
|
"--smart-case",
|
||||||
"--fixed-strings",
|
"--fixed-strings",
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
require("telescope").load_extension("fzf")
|
require("telescope").load_extension("fzf")
|
||||||
end,
|
end,
|
||||||
|
|
@ -257,9 +260,9 @@ require("lazy").setup({
|
||||||
config = function()
|
config = function()
|
||||||
require("toggleterm").setup({
|
require("toggleterm").setup({
|
||||||
hide_numbers = true,
|
hide_numbers = true,
|
||||||
direction = 'float',
|
direction = "float",
|
||||||
open_mapping = [[<C-j>]],
|
open_mapping = [[<C-j>]],
|
||||||
shell = 'fish',
|
shell = "fish",
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
@ -269,7 +272,7 @@ require("lazy").setup({
|
||||||
"CRAG666/code_runner.nvim",
|
"CRAG666/code_runner.nvim",
|
||||||
cmd = "RunCode",
|
cmd = "RunCode",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"akinsho/nvim-toggleterm.lua"
|
"akinsho/nvim-toggleterm.lua",
|
||||||
},
|
},
|
||||||
opts = {
|
opts = {
|
||||||
mode = "toggleterm",
|
mode = "toggleterm",
|
||||||
|
|
@ -316,6 +319,6 @@ require("lazy").setup({
|
||||||
"karb94/neoscroll.nvim",
|
"karb94/neoscroll.nvim",
|
||||||
opts = {
|
opts = {
|
||||||
easing_function = "sine",
|
easing_function = "sine",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue