Added Formatters

This commit is contained in:
Steven Medeiros Melo
2025-04-08 15:10:24 -04:00
parent aab323b161
commit 89934e9c95
29 changed files with 729 additions and 527 deletions

View File

@@ -1,41 +1,46 @@
{ {
"LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
"cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"colorful-winsep.nvim": { "branch": "alpha", "commit": "0070484536ea55ec64a8453d41e3badace04a61a" }, "colorful-winsep.nvim": { "branch": "alpha", "commit": "0070484536ea55ec64a8453d41e3badace04a61a" },
"emoji.nvim": { "branch": "main", "commit": "5c68359b56d2470583832b6b2b559566c5b39dc8" }, "emoji.nvim": { "branch": "main", "commit": "5c68359b56d2470583832b6b2b559566c5b39dc8" },
"fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" },
"fzf-lua": { "branch": "main", "commit": "9b84b53f3297d4912d7eb95b979e9b27e2e61281" }, "fzf-lua": { "branch": "main", "commit": "6488ada2f376e47789391dc353b6d91a3f9de6f6" },
"gitsigns.nvim": { "branch": "main", "commit": "3c76f7fabac723aa682365ef782f88a83ccdb4ac" },
"harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" }, "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" },
"lazy.nvim": { "branch": "main", "commit": "e5e9bf48211a13d9ee6c1077c88327c49c1ab4a0" }, "jest.nvim": { "branch": "master", "commit": "1ec13b863512f3673116986e6d27dc49bc17b829" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" },
"lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" }, "lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" },
"lualine.nvim": { "branch": "master", "commit": "f4f791f67e70d378a754d02da068231d2352e5bc" }, "lualine.nvim": { "branch": "master", "commit": "1517caa8fff05e4b4999857319d3b0609a7f57fa" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
"mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" },
"mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" },
"mini.comment": { "branch": "main", "commit": "264b8a63edd5a9a41d5361a1d52c13131c3c51a2" }, "mini.comment": { "branch": "main", "commit": "fb867a9246f9b892cf51a8c84a3f8479cdf1558c" },
"mini.indentscope": { "branch": "main", "commit": "8ce41a77eed7f4121c83c67fda5e2e86af999e6d" }, "mini.indentscope": { "branch": "main", "commit": "8af2569a7d7fd37300dfa760e44e71efbbf322fd" },
"mini.move": { "branch": "main", "commit": "c8b30e92dd2668dd6e56a9a23cb7d4ee38c2266d" }, "mini.move": { "branch": "main", "commit": "4fe4a855fee53c66b0f3255a4b54ddc2ae6b308c" },
"mini.pairs": { "branch": "main", "commit": "1a3e73649c0eaef2f6c48ce1e761c6f0a7c11918" }, "mini.pairs": { "branch": "main", "commit": "69864a2efb36c030877421634487fd90db1e4298" },
"mini.surround": { "branch": "main", "commit": "f90069c7441a5fb04c3de42eacf93e16b64dd3eb" }, "mini.surround": { "branch": "main", "commit": "5aab42fcdcf31fa010f012771eda5631c077840a" },
"nvim-autopairs": { "branch": "master", "commit": "68f0e5c3dab23261a945272032ee6700af86227a" }, "none-ls.nvim": { "branch": "main", "commit": "a117163db44c256d53c3be8717f3e1a2a28e6299" },
"nvim-cmp": { "branch": "main", "commit": "12509903a5723a876abd65953109f926f4634c30" }, "nvim-autopairs": { "branch": "master", "commit": "84a81a7d1f28b381b32acf1e8fe5ff5bef4f7968" },
"nvim-lspconfig": { "branch": "master", "commit": "6b63bdf2399b9bedf93297d98419550523a9ad68" }, "nvim-cmp": { "branch": "main", "commit": "059e89495b3ec09395262f16b1ad441a38081d04" },
"nvim-svelte-snippets": { "branch": "main", "commit": "0b8ceaebd528e52656303ddf66c584e9b67a52ba" }, "nvim-lspconfig": { "branch": "master", "commit": "40f120c10ea4b87311175539a183c3b75eab95a3" },
"nvim-tree.lua": { "branch": "master", "commit": "6709463b2d18e77f7a946027917aa00d4aaed6f4" }, "nvim-svelte-snippets": { "branch": "main", "commit": "1afae9e05c8488d4cc956c0ddaf127844816ce5f" },
"nvim-treesitter": { "branch": "master", "commit": "5774e7d3da4f681296a87fcd85d17779ad362a4f" }, "nvim-tree.lua": { "branch": "master", "commit": "44d9b58f11d5a426c297aafd0be1c9d45617a849" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" }, "nvim-treesitter": { "branch": "master", "commit": "30654ee72a69e7c76a54b66d748dae088429e863" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "9937e5e356e5b227ec56d83d0a9d0a0f6bc9cad4" },
"nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" },
"nvim-web-devicons": { "branch": "master", "commit": "1020869742ecb191f260818234517f4a1515cfe8" }, "nvim-web-devicons": { "branch": "master", "commit": "4c3a5848ee0b09ecdea73adcd2a689190aeb728c" },
"plenary": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "plenary": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"telescope-file-browser.nvim": { "branch": "master", "commit": "626998e5c1b71c130d8bc6cf7abb6709b98287bb" }, "telescope-file-browser.nvim": { "branch": "master", "commit": "626998e5c1b71c130d8bc6cf7abb6709b98287bb" },
"telescope.nvim": { "branch": "master", "commit": "78857db9e8d819d3cc1a9a7bdc1d39d127a36495" }, "telescope.nvim": { "branch": "master", "commit": "a4ed82509cecc56df1c7138920a1aeaf246c0ac5" },
"vim-prettier": { "branch": "master", "commit": "7dbdbb12c50a9f4ba72390cce2846248e4368fd0" }, "vim-fugitive": { "branch": "master", "commit": "4a745ea72fa93bb15dd077109afbb3d1809383f2" },
"vscode": { "branch": "main", "commit": "298c5ce4750a256ea208b72d7a472b8824ef2a49" }, "vscode": { "branch": "main", "commit": "49d6014ba151fc6cc585b8d5f057ca7839077bf8" },
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }, "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" },
"winbar.nvim": { "branch": "main", "commit": "13739fdb31be51a1000486189662596f07a59a31" } "winbar.nvim": { "branch": "main", "commit": "13739fdb31be51a1000486189662596f07a59a31" }
} }

View File

@@ -4,10 +4,10 @@ require("stevenmm.remap")
require("stevenmm.lazy_init") require("stevenmm.lazy_init")
local augroup = vim.api.nvim_create_augroup local augroup = vim.api.nvim_create_augroup
local StevenmmGroup = augroup('Stevenmm', {}) local StevenmmGroup = augroup("Stevenmm", {})
local autocmd = vim.api.nvim_create_autocmd local autocmd = vim.api.nvim_create_autocmd
local yank_group = augroup('HighlightYank', {}) local yank_group = augroup("HighlightYank", {})
function R(name) function R(name)
require("plenary.reload").reload_module(name) require("plenary.reload").reload_module(name)
@@ -15,16 +15,16 @@ end
vim.filetype.add({ vim.filetype.add({
extension = { extension = {
templ = 'templ', templ = "templ",
} },
}) })
autocmd('TextYankPost', { autocmd("TextYankPost", {
group = yank_group, group = yank_group,
pattern = '*', pattern = "*",
callback = function() callback = function()
vim.highlight.on_yank({ vim.highlight.on_yank({
higroup = 'IncSearch', higroup = "IncSearch",
timeout = 40, timeout = 40,
}) })
end, end,
@@ -36,23 +36,30 @@ autocmd({"BufWritePre"}, {
command = [[%s/\s\+$//e]], command = [[%s/\s\+$//e]],
}) })
autocmd('LspAttach', { autocmd("LspAttach", {
group = StevenmmGroup, group = StevenmmGroup,
callback = function(e) callback = function(e)
local opts = { buffer = e.buf } local opts = { buffer = e.buf }
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) -- vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
vim.keymap.set("n", "gd", ":lua vim.lsp.buf.definition()<CR>", opts)
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts) vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts) vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts) vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts)
vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts) vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts)
vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.reference() end, opts) vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts)
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts) vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts) vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
vim.keymap.set("n", "[d", function() vim.lsp.buf.goto_next() end, opts) vim.keymap.set("n", "[d", function() vim.lsp.buf.goto_next() end, opts)
vim.keymap.set("n", "]d", function() vim.lsp.buf.goto_prev() end, opts) vim.keymap.set("n", "]d", function() vim.lsp.buf.goto_prev() end, opts)
end end,
}) })
vim.g.netrw_browse_split = 0 vim.g.netrw_browse_split = 0
vim.g.netrw_banner = 0 vim.g.netrw_banner = 0
vim.g.netrw_winsize = 25 vim.g.netrw_winsize = 25
vim.g.have_nerd_font = true
vim.g.lazydev_enabled = true
vim.g.jest_command = "npx jest"
vim.g.jest_options = "--silent --coverage --no-cache"
vim.g.jest_run_watch = 1

View File

@@ -1,6 +1,4 @@
return { return {}
}
-- return { -- return {
-- "adalessa/laravel.nvim", -- "adalessa/laravel.nvim",
-- dependencies = { -- dependencies = {

View File

@@ -14,24 +14,33 @@ return {
"onsails/lspkind.nvim", "onsails/lspkind.nvim",
}, },
-- opts = function(_, opts)
-- opts.sources = vim.tbl_filter(function(source)
-- return not vim.tbl_contains({ "buffer", "nvim_lsp" }, source.name)
-- end, opts.sources)
-- table.insert(opts.sources, 1, {
-- name = "nvim_lsp",
-- entry_filter = function(entry, _)
-- return require("cmp.types").lsp.CompletionItemKind[entry:get_kind()] ~= "Text"
-- end,
-- })
-- end,
config = function() config = function()
print("cmp.lua") -- print("cmp.lua")
local cmp_autopairs = require("nvim-autopairs.completion.cmp") local cmp_autopairs = require("nvim-autopairs.completion.cmp")
local cmp = require('cmp') local cmp = require("cmp")
local cmp_select = { behavior = cmp.SelectBehavior.Select } local cmp_select = { behavior = cmp.SelectBehavior.Select }
local lspkind = require("lspkind") local lspkind = require("lspkind")
cmp.event:on( cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
'confirm_done',
cmp_autopairs.on_confirm_done()
)
cmp.setup({ cmp.setup({
enabled = function() enabled = function()
-- disable completion in comments -- disable completion in comments
local context = require('cmp.config.context') local context = require("cmp.config.context")
-- keep command mode completion enabled when cursor is in a comment -- keep command mode completion enabled when cursor is in a comment
if vim.api.nvim_get_mode().mode == 'c' then if vim.api.nvim_get_mode().mode == "c" then
return true return true
else else
return not context.in_treesitter_capture("comment") and not context.in_syntax_group("Comment") return not context.in_treesitter_capture("comment") and not context.in_syntax_group("Comment")
@@ -40,12 +49,12 @@ return {
formatting = { formatting = {
format = lspkind.cmp_format({ format = lspkind.cmp_format({
mode = 'symbol_text', mode = "symbol_text",
max_width = { max_width = {
menu = 50, menu = 50,
abbr = 50, abbr = 50,
}, },
show_labelDetails = true show_labelDetails = true,
}), }),
}, },
@@ -55,38 +64,42 @@ return {
}, },
snippet = { snippet = {
expand = function(args) expand = function(args)
require('luasnip').lsp_expand(args.body) -- For `luasnip` users. require("luasnip").lsp_expand(args.body) -- For `luasnip` users.
-- require('nvim-svelte-snippets'). -- require('nvim-svelte-snippets').
end, end,
}, },
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({
['<Down>'] = cmp.mapping.select_next_item(cmp_select), ["<Down>"] = cmp.mapping.select_next_item(cmp_select),
['<Up>'] = cmp.mapping.select_prev_item(cmp_select), ["<Up>"] = cmp.mapping.select_prev_item(cmp_select),
['<C-j>'] = cmp.mapping.select_next_item(cmp_select), ["<C-j>"] = cmp.mapping.select_next_item(cmp_select),
['<C-k>'] = cmp.mapping.select_prev_item(cmp_select), ["<C-k>"] = cmp.mapping.select_prev_item(cmp_select),
['<C-b>'] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }), ["<C-b>"] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }),
['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }), ["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }),
['<C-Space>'] = cmp.mapping.complete({ -- ['<C-Space>'] = function ()
config = { -- vim.lsp.completion.get()
sources = { -- end,sV
{ name = 'luasnip' } -- cmp.mapping.complete(),
} -- {
} -- config = {
}), -- sources = {
['<C-e>'] = cmp.mapping({ -- { name = 'luasnip' }
-- }
-- }
-- }),
["<C-e>"] = cmp.mapping({
i = cmp.mapping.abort(), i = cmp.mapping.abort(),
c = cmp.mapping.close(), c = cmp.mapping.close(),
}), }),
--['<C-y>'] = cmp.mapping.confirm({ select = true }), --['<C-y>'] = cmp.mapping.confirm({ select = true }),
['<CR>'] = cmp.mapping.confirm({ select = true }), ["<CR>"] = cmp.mapping.confirm({ select = true }),
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
}, {
{ name = 'buffer' },
}), }),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
}, {
{ name = "buffer" },
}),
}) })
end end,
} }

View File

@@ -1,6 +1,6 @@
require("stevenmm.variables") require("stevenmm.variables")
return { return {
'nvim-zh/colorful-winsep.nvim', "nvim-zh/colorful-winsep.nvim",
config = function() config = function()
local winsep = require("colorful-winsep") local winsep = require("colorful-winsep")
local bg = require("vscode.colors").get_colors().vscBack local bg = require("vscode.colors").get_colors().vscBack
@@ -12,5 +12,5 @@ return {
no_exec_files = EXCLUDED_FILETYPES_ARRAY, no_exec_files = EXCLUDED_FILETYPES_ARRAY,
symbols = { "", "", "", "", "", "" }, symbols = { "", "", "", "", "", "" },
}) })
end end,
} }

View File

@@ -31,6 +31,6 @@ return {
vim.cmd("colorscheme vscode") vim.cmd("colorscheme vscode")
ColorMyPencils() ColorMyPencils()
end end,
}, },
} }

View File

@@ -1,8 +1,8 @@
return { return {
'JoosepAlviste/nvim-ts-context-commentstring', "JoosepAlviste/nvim-ts-context-commentstring",
config = function() config = function()
require('ts_context_commentstring').setup({ require("ts_context_commentstring").setup({
enable_autocmd = false, enable_autocmd = false,
}) })
end end,
} }

View File

@@ -0,0 +1,42 @@
return {
"nvimtools/none-ls.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = function()
local null_ls = require("null-ls")
null_ls.setup({
sources = {
null_ls.builtins.formatting.prettierd.with({
filetypes = {
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"css",
"html",
"json",
},
}),
null_ls.builtins.formatting.stylua.with({
syntax = "All",
indent_type = "Tabs",
indent_width = 4,
quote_style = "AutoPreferDouble",
space_after_function_names = "Always",
collapse_simple_statement = "FunctionOnly",
}),
-- require("none-ls.diagnostics.eslint"),
},
on_attach = function(client, bufnr)
if client.supports_method("textDocument/formatting") then
-- vim.api.nvim_buf_set_option(bufnr, "formatexpr", "v:lua.vim.lsp.formatexpr()")
vim.api.nvim_set_option_value("formatexpr", "v:lua.vim.lsp.formatexpr()", { buf = bufnr })
end
end,
})
end,
}

View File

@@ -0,0 +1,13 @@
return {
{
"tpope/vim-fugitive",
},
{
"lewis6991/gitsigns.nvim",
config = function()
require("gitsigns").setup()
-- vim.keymap
end,
},
}

View File

@@ -1,20 +1,39 @@
return { return {
"ThePrimeagen/harpoon", "ThePrimeagen/harpoon",
branch = "harpoon2", branch = "harpoon2",
-- dependencies = { dependencies = {
-- "nvim-lua/plenary.nvim" "nvim-lua/plenary.nvim",
-- },
global_settings = {
}, },
-- config = function () -- global_settings = {
-- local harpoon = require('harpoon')
-- harpoon:setup({})
-- --
-- -- vim.keymap.set("n", "<leader>a", function () harpoon:list():add() end) -- },
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-t>", function() harpoon:list():select(2) end)
vim.keymap.set("n", "<C-n>", function() harpoon:list():select(3) end)
vim.keymap.set("n", "<C-s>", function() harpoon:list():select(4) end)
vim.keymap.set("n", "<C-S-P>", function() harpoon:list():prev() end)
vim.keymap.set("n", "<C-S-N>", function() harpoon:list():next() end)
-- vim.keymap.set("n", "<leader>a", ":lua harpoon:list():add()")
-- vim.keymap.set("n", "<C-e>", ":lua harpoon.ui:toggle_quick_menu(harpoon:list())<CR>")
-- --
-- end -- vim.keymap.set("n", "<C-h>", "harpoon:list():select(1)")
-- vim.keymap.set("n", "<C-t>", "harpoon:list():select(2)")
-- vim.keymap.set("n", "<C-n>", "harpoon:list():select(3)")
-- vim.keymap.set("n", "<C-s>", "harpoon:list():select(4)")
--
-- vim.keymap.set("n", "<C-S-P>", "harpoon:list():prev()")
-- vim.keymap.set("n", "<C-S-N>", "harpoon:list():next()")
end,
} }

View File

@@ -1,7 +1,7 @@
return { return {
{ {
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
name = "plenary" name = "plenary",
}, },
-- "github/copilot.vim", -- "github/copilot.vim",

View File

@@ -0,0 +1,10 @@
return {
"mattkubej/jest.nvim",
config = function()
local jest = require("nvim-jest")
jest.setup({
silent = false,
})
end,
}

View File

@@ -0,0 +1,19 @@
return {
"folke/lazydev.nvim",
ft = "lua",
opts = {
library = {
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
"LazyVim",
},
integrations = {
cmp = true,
lspconfig = true,
},
},
-- config = function()
-- local lazydev = require("lazydev.nvim")
--
-- lazydev.setup({})
-- end,
}

View File

@@ -8,6 +8,8 @@ return {
"williamboman/mason.nvim", "williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim", "williamboman/mason-lspconfig.nvim",
"folke/lazydev.nvim",
-- cmp configs: -- cmp configs:
"hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer", "hrsh7th/cmp-buffer",
@@ -26,19 +28,43 @@ return {
}, },
config = function() config = function()
print("lsp.lua") -- print("lsp.lua")
local lspconfig = require("lspconfig")
require("fidget").setup({}) require("fidget").setup({})
lspconfig.lua_ls.setup({
settings = {
Lua = {
runtime = {
version = "LuaJIT",
},
format = {
enable = false,
},
diagnostics = {
globals = {
"vim",
},
},
workspace = {
library = vim.api.nvim_get_runtime_file("", true),
},
telemetry = {
enable = false,
},
},
},
})
vim.diagnostic.config({ vim.diagnostic.config({
-- virtual_text = false, -- virtual_text = false,
signs = { signs = {
text = { text = {
[vim.diagnostic.severity.ERROR] = '', [vim.diagnostic.severity.ERROR] = "",
[vim.diagnostic.severity.WARN] = '', [vim.diagnostic.severity.WARN] = "",
[vim.diagnostic.severity.INFO] = '', [vim.diagnostic.severity.INFO] = "",
[vim.diagnostic.severity.HINT] = '󰌶', [vim.diagnostic.severity.HINT] = "󰌶",
} },
}, },
update_in_insert = true, update_in_insert = true,
float = { float = {
@@ -53,6 +79,5 @@ return {
-- vim.o.updatetime = 250 -- vim.o.updatetime = 250
-- vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]] -- vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]]
end end,
} }

View File

@@ -27,10 +27,10 @@ return {
lazy = false, lazy = false,
priority = 999, priority = 999,
config = function() config = function()
local lualine = require('lualine') local lualine = require("lualine")
lualine.setup({ lualine.setup({
options = { options = {
theme = 'auto', theme = "auto",
section_separators = { left = "", right = "" }, section_separators = { left = "", right = "" },
-- always_show_tabline = false, -- always_show_tabline = false,
-- ignore_focus = {}, -- ignore_focus = {},
@@ -58,26 +58,26 @@ return {
-- }, -- },
-- }, -- },
{ {
'mode', "mode",
-- fmt = function(str) return '[' .. str:sub(1,2) .. ']' end, -- fmt = function(str) return '[' .. str:sub(1,2) .. ']' end,
-- separator = "|" -- separator = "|"
}, },
}, },
lualine_b = { lualine_b = {
{ {
'branch', "branch",
separator = "" separator = "",
}, },
{ {
'diff', "diff",
}, },
}, },
lualine_c = { lualine_c = {
{ {
'filetype', "filetype",
-- icons_enabled = true, -- icons_enabled = true,
icon_only = false, icon_only = false,
icon = { align = 'left' }, icon = { align = "left" },
separator = "", separator = "",
}, },
-- { -- {
@@ -105,23 +105,23 @@ return {
color = { fg = "#ff9e64" }, color = { fg = "#ff9e64" },
}, },
{ {
'diagnostics', "diagnostics",
update_in_insert = true, update_in_insert = true,
separator = "", separator = "",
}, },
}, },
lualine_y = { lualine_y = {
{ {
'location', "location",
}, },
}, },
lualine_z = { lualine_z = {
{ {
'datetime', "datetime",
-- icons_enabled = true, -- icons_enabled = true,
-- icon = { '' }, -- icon = { '' },
-- separator = "🌴", -- separator = "🌴",
style = '%H:%M:%S', style = "%H:%M:%S",
}, },
}, },
}, },
@@ -137,17 +137,15 @@ return {
"filename", "filename",
path = 1, path = 1,
-- fmt = format_name -- fmt = format_name
}, },
}, },
lualine_x = {}, lualine_x = {},
lualine_y = {}, lualine_y = {},
lualine_z = {}, lualine_z = {},
}, },
winbar = { winbar = {},
},
extensions = { extensions = {
nvimtree nvimtree,
}, },
}) })
end, end,

View File

@@ -3,60 +3,85 @@ return {
dependencies = { dependencies = {
"hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-nvim-lsp",
"williamboman/mason-lspconfig.nvim", "williamboman/mason-lspconfig.nvim",
"jay-babu/mason-null-ls.nvim",
}, },
config = function() config = function()
print('mason.lua') -- print('mason.lua')
local lspconfig = require("lspconfig")
local capabilities = vim.tbl_deep_extend( local capabilities = vim.tbl_deep_extend(
"force", "force",
{}, {},
vim.lsp.protocol.make_client_capabilities(), vim.lsp.protocol.make_client_capabilities(),
require('cmp_nvim_lsp').default_capabilities() require("cmp_nvim_lsp").default_capabilities()
) )
require('mason').setup({}) require("mason").setup({})
require('mason-lspconfig').setup({ require("mason-lspconfig").setup({
ensure_installed = { ensure_installed = {
"ts_ls",
"gopls", "gopls",
"clangd", "clangd",
"lua_ls",
"rust_analyzer", "rust_analyzer",
-- "lua_ls",
-- "php" -- "php"
-- "tsserver",
}, },
handlers = { handlers = {
function(server_name) -- default handler (optional) function(server_name) -- default handler (optional)
require("lspconfig")[server_name].setup { require("lspconfig")[server_name].setup({
capabilities = capabilities
}
end,
["lua_ls"] = function()
local lspconfig = require("lspconfig")
lspconfig.lua_ls.setup {
capabilities = capabilities, capabilities = capabilities,
settings = { })
Lua = {
diagnostics = {
globals = { "vim", "it", "describe", "before_each", "after_each" },
}
}
}
}
end, end,
["ts_ls"] = function()
-- local function organize_imports()
-- local params = {
-- command = "_typescript.organizeImports",
-- arguments = { vim.api.nvim_buf_get_name(0) },
-- title = "",
-- }
-- vim.lsp.buf.execute_command(params)
-- end
lspconfig.ts_ls.setup({
capabilities = capabilities,
-- commands = {
-- OrganizeImports = {
-- organize_imports(),
-- description = "Organize Imports",
-- },
-- },
})
end,
-- ["lua_ls"] = function()
-- local lspconfig = require("lspconfig")
-- lspconfig.lua_ls.setup({
-- capabilities = capabilities,
-- settings = {
-- Lua = {
-- -- workspace = {
-- -- checkThirdParty = false,
-- -- library = vim.api.nvim_get_runtime_file("", true),
-- -- },
-- diagnostics = {
-- globals = { "vim", "it", "describe", "before_each", "after_each" },
-- },
-- },
-- },
-- })
-- end,
["clangd"] = function() ["clangd"] = function()
local lspconfig = require("lspconfig") -- local lspconfig = require("lspconfig")
lspconfig.clangd.setup({ lspconfig.clangd.setup({
capabilities = capabilities, capabilities = capabilities,
}) })
end, end,
["gopls"] = function() ["gopls"] = function()
local lspconfig = require("lspconfig") -- local lspconfig = require("lspconfig")
lspconfig.gopls.setup { lspconfig.gopls.setup({
capabilities = capabilities, capabilities = capabilities,
}
end
}
}) })
end end,
},
})
end,
} }

View File

@@ -1,13 +1,13 @@
return { return {
'echasnovski/mini.comment', "echasnovski/mini.comment",
version = false, version = false,
config = function() config = function()
require('mini.comment').setup({ require("mini.comment").setup({
options = { options = {
custom_commentstring = function() custom_commentstring = function()
return require('ts_context_commentstring').calculate_commentstring() or vim.bo.commentstring return require("ts_context_commentstring").calculate_commentstring() or vim.bo.commentstring
end end,
}, },
}) })
end end,
} }

View File

@@ -1,7 +1,7 @@
return { return {
'echasnovski/mini.indentscope', "echasnovski/mini.indentscope",
version = false, version = false,
config = function() config = function()
require('mini.indentscope').setup() require("mini.indentscope").setup()
end end,
} }

View File

@@ -1,7 +1,7 @@
return { return {
'echasnovski/mini.move', "echasnovski/mini.move",
version = false, version = false,
config = function() config = function()
require('mini.move').setup() require("mini.move").setup()
end, end,
} }

View File

@@ -1,7 +1,7 @@
return { return {
'echasnovski/mini.pairs', "echasnovski/mini.pairs",
version = false, version = false,
config = function() config = function()
require('mini.pairs').setup() require("mini.pairs").setup()
end, end,
} }

View File

@@ -1,7 +1,7 @@
return { return {
'echasnovski/mini.surround', "echasnovski/mini.surround",
version = false, version = false,
config = function() config = function()
require('mini.surround').setup() require("mini.surround").setup()
end end,
} }

View File

@@ -1,5 +1,5 @@
return { return {
"windwp/nvim-autopairs", "windwp/nvim-autopairs",
event = "InsertEnter", event = "InsertEnter",
config = true config = true,
} }

View File

@@ -1,7 +0,0 @@
return {
"prettier/vim-prettier",
-- config = function()
-- require("vim-prettier").setup()
-- end,
}

View File

@@ -14,6 +14,6 @@ vim.opt.rtp:prepend(lazypath)
require("lazy").setup({ require("lazy").setup({
spec = "stevenmm.lazy", spec = "stevenmm.lazy",
change_detection = { notify = false }, change_detection = { notify = false },
'JoosepAlviste/nvim-ts-context-commentstring', "JoosepAlviste/nvim-ts-context-commentstring",
-- "nvim-lua/plenary.nvim" -- "nvim-lua/plenary.nvim"
}) })

View File

@@ -1,11 +1,31 @@
vim.g.mapleader = " " vim.g.mapleader = " "
local keyset = vim.keymap.set local keyset = vim.keymap.set
local function noremap_opts(cmd_description)
return { noremap = true, silent = true, desc = cmd_description }
end
keyset("", "<Caps_lock>", "<Esc>") -- Lazy:
keyset("n", "<leader>la", ":Lazy<CR>", { silent = true })
-- Mason:
keyset("n", "<leader>ma", ":Mason<CR>", { silent = true }) keyset("n", "<leader>ma", ":Mason<CR>", { silent = true })
-- NvimTree
keyset("n", "<leader>na", ":NvimTreeToggle<CR>", { silent = true }) keyset("n", "<leader>na", ":NvimTreeToggle<CR>", { silent = true })
keyset('n', '<leader>la', ":Lazy<CR>", { silent = true })
keyset("n", "<leader>fb", ":Telescope file_browser path=%:p:h<CR>", { noremap = true, silent = true }) -- Telescope:
keyset("n", "<leader>ha", ":Telescope harpoon marks<CR>", { noremap = true, silent = true }) keyset("n", "<leader>fb", ":Telescope file_browser path=%:p:h<CR>", noremap_opts("Telescope File Browser"))
keyset('n', '<leader>se', ":Telescope emoji<cr>", { desc = '[S]earch [E]moji' }) keyset("n", "<leader>ha", ":Telescope harpoon marks<CR>", noremap_opts("Telescope Harpoon"))
keyset("n", "<leader>se", ":Telescope emoji<CR>", { desc = "[S]earch [E]moji" })
-- Gitsigns:
keyset("n", "<leader>gp", ":Gitsigns preview_hunk<CR>", {})
keyset("n", "<leader>gt", ":Gitsigns toggle_current_line_blame<CR>", {})
-- Formatting:
keyset("n", "<leader>ff", ":lua vim.lsp.buf.format()<CR>", noremap_opts("Format Current File"))
-- keyset("", "<Caps_lock>", "<Esc>")
-- keyset("n", "<leader>p", ":Prettier<CR>", { noremap = true, silent = true })
-- keyset("n", "<leader>ff", ":lua vim.lsp.buf.format()<CR>", { noremap = true, silent = true, desc = "Format Current File" })

View File

@@ -3,12 +3,23 @@
vim.opt.number = true vim.opt.number = true
vim.opt.relativenumber = true vim.opt.relativenumber = true
vim.opt.encoding = 'UTF-8' vim.opt.encoding = "UTF-8"
vim.opt.guifont = 'NotoSansM Nerd Font Mono' vim.opt.guifont = "NotoSansM Nerd Font Mono"
vim.opt.clipboard = "unnamedplus"
vim.opt.inccommand = "split"
vim.opt.splitright = true
-- vim.opt.splitbelow = true
-- vim.opt.tabstop = 4
-- vim.opt.softtabstop = 4
-- vim.opt.shiftwidth = 4
vim.opt.tabstop = 2
vim.opt.softtabstop = 2
vim.opt.shiftwidth = 2
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.smarttab = false vim.opt.smarttab = false
vim.opt.expandtab = true vim.opt.expandtab = true
@@ -24,12 +35,12 @@ vim.opt.colorcolumn = "80"
vim.opt.swapfile = false vim.opt.swapfile = false
vim.opt.backup = false vim.opt.backup = false
if vim.fn.has('win32') or vim.fn.has('win64') then if vim.fn.has("win32") or vim.fn.has("win64") then
vim.opt.undodir = os.getenv("XDG_CONFIG_HOME") .. "/.vim/undodir" vim.opt.undodir = os.getenv("XDG_CONFIG_HOME") .. "/.vim/undodir"
vim.opt.shell = 'powershell.exe' vim.opt.shell = "powershell.exe"
else else
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
vim.opt.shell = 'bash' vim.opt.shell = "bash"
end end
vim.opt.undofile = true vim.opt.undofile = true
@@ -39,8 +50,12 @@ vim.opt.incsearch = true
vim.opt.termguicolors = true vim.opt.termguicolors = true
vim.opt.scrolloff = 8 -- vim.opt.scrolloff = 8
vim.opt.scrolloff = 10
vim.opt.signcolumn = "yes" vim.opt.signcolumn = "yes"
vim.opt.isfname:append("@-@") vim.opt.isfname:append("@-@")
vim.opt.updatetime = 50 vim.opt.updatetime = 50
vim.opt.grepprg = "rg --vimgrep"
vim.opt.grepformat = "%f:%l:%c:%m"