feat: formatting with conform
parent
9095ced549
commit
1a36e16bf6
3
init.lua
3
init.lua
|
@ -1,5 +1,4 @@
|
||||||
require("plugins")
|
require("plugins")
|
||||||
require("options")
|
|
||||||
require("colorscheme")
|
require("colorscheme")
|
||||||
require("lsp")
|
require("lsp")
|
||||||
require("config.telescope")
|
require("config.telescope")
|
||||||
|
@ -13,5 +12,7 @@ require("config.fterm")
|
||||||
require("config.harpoon")
|
require("config.harpoon")
|
||||||
require("config.autopairs")
|
require("config.autopairs")
|
||||||
require("config.autotags")
|
require("config.autotags")
|
||||||
|
require("config.conform")
|
||||||
-- require("config.dashboard")
|
-- require("config.dashboard")
|
||||||
|
require("options")
|
||||||
require("keymaps")
|
require("keymaps")
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
|
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
|
||||||
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
|
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
|
||||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||||
|
"conform.nvim": { "branch": "master", "commit": "9d5ba06d6ee7418c674f498634617416d15b6239" },
|
||||||
"copilot.vim": { "branch": "release", "commit": "7097b09e52621a97d11f254e04de5e5a0f26e5f5" },
|
"copilot.vim": { "branch": "release", "commit": "7097b09e52621a97d11f254e04de5e5a0f26e5f5" },
|
||||||
"dashboard-nvim": { "branch": "master", "commit": "681300934baf36f6184ca41f0b26aed22056d4ee" },
|
"dashboard-nvim": { "branch": "master", "commit": "681300934baf36f6184ca41f0b26aed22056d4ee" },
|
||||||
"harpoon": { "branch": "harpoon2", "commit": "da326d0438ac68dee9b6b62a734be940a8bd8405" },
|
"harpoon": { "branch": "harpoon2", "commit": "da326d0438ac68dee9b6b62a734be940a8bd8405" },
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
require("conform").setup({
|
||||||
|
formatters_by_ft = {
|
||||||
|
lua = { "stylua" },
|
||||||
|
python = { "isort", "black" },
|
||||||
|
javascript = { { "prettierd", "prettier" } },
|
||||||
|
json = { { "prettierd", "prettier" } },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
M.format = function(args)
|
||||||
|
local range = nil
|
||||||
|
if args and args.count ~= -1 then
|
||||||
|
-- Assuming args.line1 and args.line2 are provided and valid
|
||||||
|
local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
|
||||||
|
range = {
|
||||||
|
start = { args.line1, 0 },
|
||||||
|
["end"] = { args.line2, end_line:len() },
|
||||||
|
}
|
||||||
|
end
|
||||||
|
require("conform").format({ async = true, lsp_fallback = true, range = range })
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_create_user_command("Format", function(args)
|
||||||
|
M.format(args)
|
||||||
|
end, { range = true })
|
||||||
|
|
||||||
|
return M
|
|
@ -20,6 +20,5 @@ require('mason-lspconfig').setup({
|
||||||
'tsserver',
|
'tsserver',
|
||||||
'jsonls',
|
'jsonls',
|
||||||
'lua_ls',
|
'lua_ls',
|
||||||
'prettier'
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
121
lua/keymaps.lua
121
lua/keymaps.lua
|
@ -1,71 +1,68 @@
|
||||||
local fterm = require('FTerm')
|
|
||||||
local keymap = vim.api.nvim_set_keymap
|
local keymap = vim.api.nvim_set_keymap
|
||||||
local opts = { noremap = true, silent = true }
|
local opts = { noremap = true, silent = true }
|
||||||
local api = vim.api
|
|
||||||
|
|
||||||
-- Custom commands
|
|
||||||
api.nvim_create_user_command('FTermToggle', fterm.toggle, { bang = true })
|
|
||||||
api.nvim_create_user_command('FTermClose', fterm.close, { bang = true })
|
|
||||||
local mappings = {
|
local mappings = {
|
||||||
n = {
|
n = {
|
||||||
-- highlighting
|
-- highlighting
|
||||||
["<leader>nh"] = ":nohl<CR>",
|
["<leader>nh"] = ":nohl<CR>",
|
||||||
-- move between buffers
|
-- move between buffers
|
||||||
["<c-h>"] = "<C-w>h",
|
["<c-h>"] = "<C-w>h",
|
||||||
["<c-j>"] = "<C-w>j",
|
["<c-j>"] = "<C-w>j",
|
||||||
["<c-k>"] = "<C-w>k",
|
["<c-k>"] = "<C-w>k",
|
||||||
["<c-l>"] = "<C-w>l",
|
["<c-l>"] = "<C-w>l",
|
||||||
-- open and close buggers
|
-- open and close buggers
|
||||||
["<leader>sv"] = "<C-w>s",
|
["<leader>sv"] = "<C-w>s",
|
||||||
["<leader>sh"] = "<C-w>v",
|
["<leader>sh"] = "<C-w>v",
|
||||||
["<leader>se"] = "<C-w>=",
|
["<leader>se"] = "<C-w>=",
|
||||||
["<leader>sx"] = ":close<CR>",
|
["<leader>sx"] = ":close<CR>",
|
||||||
-- nvim-tree
|
-- nvim-tree
|
||||||
["<leader>e"] = ":NvimTreeToggle<CR>",
|
["<leader>e"] = ":NvimTreeToggle<CR>",
|
||||||
["<leader>cf"] = ":NvimTreeCollapse<CR>",
|
["<leader>cf"] = ":NvimTreeCollapse<CR>",
|
||||||
-- LSP
|
-- LSP
|
||||||
["<leader>ls"] = ":lspstop<CR>",
|
["<leader>ls"] = ":lspstop<CR>",
|
||||||
["<leader>lo"] = ":lspstart<CR>",
|
["<leader>lo"] = ":lspstart<CR>",
|
||||||
-- Telescope
|
-- Telescope
|
||||||
["<leader>ff"] = "<cmd>Telescope find_files<CR>",
|
["<leader>ff"] = "<cmd>Telescope find_files<CR>",
|
||||||
["<leader>fw"] = "<cmd>Telescope live_grep<CR>",
|
["<leader>fw"] = "<cmd>Telescope live_grep<CR>",
|
||||||
["<leader>fc"] = "<cmd>Telescope grep_string<CR>",
|
["<leader>fc"] = "<cmd>Telescope grep_string<CR>",
|
||||||
["<leader>th"] = "<cmd>Themery<CR>",
|
["<leader>th"] = "<cmd>Themery<CR>",
|
||||||
["<leader>sm"] = ":MaximizerToggle<CR>",
|
["<leader>sm"] = ":MaximizerToggle<CR>",
|
||||||
-- FTerm
|
-- FTerm
|
||||||
["<leader>h"] = "<cmd>FTermToggle<CR>",
|
["<leader>h"] = "<cmd>FTermToggle<CR>",
|
||||||
-- Harpoon
|
-- Harpoon
|
||||||
["<leader>a"] = "<cmd>HarpoonAdd<CR>",
|
["<leader>a"] = "<cmd>HarpoonAdd<CR>",
|
||||||
["<C-e>"] = "<cmd>HarpoonUI<CR>"
|
["<C-e>"] = "<cmd>HarpoonUI<CR>",
|
||||||
},
|
-- Formating
|
||||||
x = {
|
["<leader>fm"] = "<cmd>Format<CR>",
|
||||||
["<A-j>"] = ":move '>+1<CR>gv-gv",
|
},
|
||||||
["<A-k>"] = ":move '<-2<CR>gv-gv",
|
x = {
|
||||||
},
|
["<A-j>"] = ":move '>+1<CR>gv-gv",
|
||||||
i = {
|
["<A-k>"] = ":move '<-2<CR>gv-gv",
|
||||||
["<C-Space>"] = { 'copilot#Accept("<CR>")', expr = true },
|
},
|
||||||
["<A-l>"] = "<esc>",
|
i = {
|
||||||
},
|
["<C-Space>"] = { 'copilot#Accept("<CR>")', expr = true },
|
||||||
t = {
|
["<A-l>"] = "<esc>",
|
||||||
["A-l"] = "<cmd>FTermClose<CR>"
|
},
|
||||||
}
|
t = {
|
||||||
|
["A-l"] = "<cmd>FTermClose<CR>",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for mode, mode_mappings in pairs(mappings) do
|
for mode, mode_mappings in pairs(mappings) do
|
||||||
for key, mapping in pairs(mode_mappings) do
|
for key, mapping in pairs(mode_mappings) do
|
||||||
if type(mapping) == "function" then
|
if type(mapping) == "function" then
|
||||||
-- For direct Lua function calls; ensure your function returns a string command
|
-- For direct Lua function calls; ensure your function returns a string command
|
||||||
keymap(mode, key, "<cmd>lua " .. mapping() .. "<CR>", opts)
|
keymap(mode, key, "<cmd>lua " .. mapping() .. "<CR>", opts)
|
||||||
elseif type(mapping) == "table" and mapping.expr then
|
elseif type(mapping) == "table" and mapping.expr then
|
||||||
-- For expression mappings, like for copilot
|
-- For expression mappings, like for copilot
|
||||||
local expr_opts = vim.tbl_extend("force", opts, { expr = true })
|
local expr_opts = vim.tbl_extend("force", opts, { expr = true })
|
||||||
keymap(mode, key, mapping[1], expr_opts)
|
keymap(mode, key, mapping[1], expr_opts)
|
||||||
elseif type(mapping) == "table" then
|
elseif type(mapping) == "table" then
|
||||||
-- For mappings that have their options specified directly
|
-- For mappings that have their options specified directly
|
||||||
keymap(mode, key, mapping[1], mapping[2] or opts)
|
keymap(mode, key, mapping[1], mapping[2] or opts)
|
||||||
else
|
else
|
||||||
-- For simple string command mappings
|
-- For simple string command mappings
|
||||||
keymap(mode, key, mapping, opts)
|
keymap(mode, key, mapping, opts)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
103
lua/lsp.lua
103
lua/lsp.lua
|
@ -1,66 +1,67 @@
|
||||||
local lspconfig = require('lspconfig')
|
local lspconfig = require("lspconfig")
|
||||||
|
|
||||||
local mappings = {
|
local mappings = {
|
||||||
['<leader>k'] = vim.diagnostic.open_float,
|
["<leader>k"] = vim.diagnostic.open_float,
|
||||||
['[d'] = vim.diagnostic.goto_prev,
|
["[d"] = vim.diagnostic.goto_prev,
|
||||||
[']d'] = vim.diagnostic.goto_next,
|
["]d"] = vim.diagnostic.goto_next,
|
||||||
['<leader>q'] = vim.diagnostic.setloclist,
|
["<leader>q"] = vim.diagnostic.setloclist,
|
||||||
['gD'] = vim.lsp.buf.declaration,
|
["gD"] = vim.lsp.buf.declaration,
|
||||||
['gd'] = vim.lsp.buf.definition,
|
["gd"] = vim.lsp.buf.definition,
|
||||||
['K'] = vim.lsp.buf.hover,
|
["K"] = vim.lsp.buf.hover,
|
||||||
['gi'] = vim.lsp.buf.implementation,
|
["gi"] = vim.lsp.buf.implementation,
|
||||||
['<leader>wa'] = vim.lsp.buf.add_workspace_folder,
|
["<leader>wa"] = vim.lsp.buf.add_workspace_folder,
|
||||||
['<leader>wr'] = vim.lsp.buf.remove_workspace_folder,
|
["<leader>wr"] = vim.lsp.buf.remove_workspace_folder,
|
||||||
['<leader>wl'] = function()
|
["<leader>wl"] = function()
|
||||||
print(vim.inspect(vim.lsp.buf.list_workleader_folders()))
|
print(vim.inspect(vim.lsp.buf.list_workleader_folders()))
|
||||||
end,
|
end,
|
||||||
['<leader>D'] = vim.lsp.buf.type_definition,
|
["<leader>D"] = vim.lsp.buf.type_definition,
|
||||||
['<leader>rn'] = vim.lsp.buf.rename,
|
["<leader>rn"] = vim.lsp.buf.rename,
|
||||||
['<leader>ca'] = vim.lsp.buf.code_action,
|
["<leader>ca"] = vim.lsp.buf.code_action,
|
||||||
['gr'] = vim.lsp.buf.references,
|
["gr"] = vim.lsp.buf.references,
|
||||||
['<leader>fm'] = function()
|
["<leader>fm"] = function()
|
||||||
vim.lsp.buf.format({ async = true })
|
vim.lsp.buf.format({ async = true })
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
local on_attach = function(client, bufnr)
|
local on_attach = function(client, bufnr)
|
||||||
-- Enable completion triggered by <c-x><c-o>
|
-- Enable completion triggered by <c-x><c-o>
|
||||||
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||||
local bufopts = { noremap = true, silent = true, buffer = bufnr }
|
local bufopts = { noremap = true, silent = true, buffer = bufnr }
|
||||||
for key, mapping in pairs(mappings) do
|
for key, mapping in pairs(mappings) do
|
||||||
vim.keymap.set('n', key, mapping, bufopts)
|
vim.keymap.set("n", key, mapping, bufopts)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local servers = {
|
local servers = {
|
||||||
"tsserver",
|
"tsserver",
|
||||||
"intelephense",
|
"intelephense",
|
||||||
"tailwindcss",
|
"tailwindcss",
|
||||||
"lua_ls",
|
"lua_ls",
|
||||||
}
|
}
|
||||||
|
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
|
|
||||||
capabilities.textDocument.completion.completionItem = {
|
capabilities.textDocument.completion.completionItem = {
|
||||||
documentationFormat = { "markdown", "plaintext" },
|
documentationFormat = { "markdown", "plaintext" },
|
||||||
snippetSupport = true,
|
snippetSupport = true,
|
||||||
preselectSupport = true,
|
preselectSupport = true,
|
||||||
insertReplaceSupport = true,
|
insertReplaceSupport = true,
|
||||||
labelDetailsSupport = true,
|
labelDetailsSupport = true,
|
||||||
deprecatedSupport = true,
|
deprecatedSupport = true,
|
||||||
commitCharactersSupport = true,
|
commitCharactersSupport = true,
|
||||||
tagSupport = { valueSet = { 1 } },
|
tagSupport = { valueSet = { 1 } },
|
||||||
resolveSupport = {
|
resolveSupport = {
|
||||||
properties = {
|
properties = {
|
||||||
"documentation",
|
"documentation",
|
||||||
"detail",
|
"detail",
|
||||||
"additionalTextEdits",
|
"additionalTextEdits",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, lsp in ipairs(servers) do
|
for _, lsp in ipairs(servers) do
|
||||||
lspconfig[lsp].setup {
|
lspconfig[lsp].setup({
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
}
|
})
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
local opt = vim.opt
|
local opt = vim.opt
|
||||||
local api = vim.api
|
local api = vim.api
|
||||||
local global = vim.g
|
local global = vim.g
|
||||||
|
local formatter = require("config.conform")
|
||||||
|
|
||||||
-- Hint: use `:h <option>` to figure out the meaning if needed
|
-- Hint: use `:h <option>` to figure out the meaning if needed
|
||||||
opt.clipboard = "unnamedplus" -- use system clipboard
|
opt.clipboard = "unnamedplus" -- use system clipboard
|
||||||
opt.completeopt = { "menu", "menuone", "noselect" }
|
opt.completeopt = { "menu", "menuone", "noselect" }
|
||||||
opt.mouse = "a" -- allow the mouse to be used in Nvim
|
opt.mouse = "a" -- allow the mouse to be used in Nvim
|
||||||
|
|
||||||
-- General
|
-- General
|
||||||
opt.wrap = false
|
opt.wrap = false
|
||||||
|
@ -18,24 +19,24 @@ opt.cursorline = true
|
||||||
opt.backspace = "indent,eol,start"
|
opt.backspace = "indent,eol,start"
|
||||||
|
|
||||||
-- Tab
|
-- Tab
|
||||||
opt.tabstop = 4 -- number of visual spaces per TAB
|
opt.tabstop = 2 -- number of visual spaces per TAB
|
||||||
opt.softtabstop = 4 -- number of spacesin tab when editing
|
opt.softtabstop = 2 -- number of spacesin tab when editing
|
||||||
opt.shiftwidth = 4 -- insert 4 spaces on a tab
|
opt.shiftwidth = 2 -- insert 4 spaces on a tab
|
||||||
opt.expandtab = true -- tabs are spaces, mainly because of python
|
opt.expandtab = true -- tabs are spaces, mainly because of python
|
||||||
|
|
||||||
-- UI config
|
-- UI config
|
||||||
opt.number = true -- show absolute number
|
opt.number = true -- show absolute number
|
||||||
-- opt.relativenumber = true -- add numbers to each line on the left side
|
-- opt.relativenumber = true -- add numbers to each line on the left side
|
||||||
opt.cursorline = true -- highlight cursor line underneath the cursor horizontally
|
opt.cursorline = true -- highlight cursor line underneath the cursor horizontally
|
||||||
opt.splitbelow = true -- open new vertical split bottom
|
opt.splitbelow = true -- open new vertical split bottom
|
||||||
opt.splitright = true -- open new horizontal splits right
|
opt.splitright = true -- open new horizontal splits right
|
||||||
opt.termguicolors = true -- enabl 24-bit RGB color in the TUI
|
opt.termguicolors = true -- enabl 24-bit RGB color in the TUI
|
||||||
|
|
||||||
-- Searching
|
-- Searching
|
||||||
opt.incsearch = true -- search as characters are entered
|
opt.incsearch = true -- search as characters are entered
|
||||||
opt.hlsearch = false -- do not highlight matches
|
opt.hlsearch = false -- do not highlight matches
|
||||||
opt.ignorecase = true -- ignore case in searches by default
|
opt.ignorecase = true -- ignore case in searches by default
|
||||||
opt.smartcase = true -- but make it case sensitive if an uppercase is entered
|
opt.smartcase = true -- but make it case sensitive if an uppercase is entered
|
||||||
|
|
||||||
-- History
|
-- History
|
||||||
opt.undofile = true
|
opt.undofile = true
|
||||||
|
@ -45,7 +46,14 @@ opt.undodir = os.getenv("HOME") .. "/.local/share/nvim/undo"
|
||||||
api.nvim_set_option("list", true)
|
api.nvim_set_option("list", true)
|
||||||
api.nvim_set_option("listchars", "eol:$,nbsp:_,tab:>-,trail:~,extends:>,precedes:<")
|
api.nvim_set_option("listchars", "eol:$,nbsp:_,tab:>-,trail:~,extends:>,precedes:<")
|
||||||
api.nvim_create_autocmd({ "BufWritePre" }, {
|
api.nvim_create_autocmd({ "BufWritePre" }, {
|
||||||
pattern = { "*" },
|
pattern = { "*" },
|
||||||
command = [[if &filetype !~# 'lsp' | %s/\s\+$//e | endif]],
|
command = [[if &filetype !~# 'lsp' | %s/\s\+$//e | endif]],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Formatting
|
||||||
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
|
pattern = "*",
|
||||||
|
callback = function()
|
||||||
|
formatter.format(nil)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
242
lua/plugins.lua
242
lua/plugins.lua
|
@ -1,24 +1,24 @@
|
||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
|
||||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
vim.fn.system({
|
vim.fn.system({
|
||||||
"git",
|
"git",
|
||||||
"clone",
|
"clone",
|
||||||
"--filter=blob:none",
|
"--filter=blob:none",
|
||||||
"https://github.com/folke/lazy.nvim.git",
|
"https://github.com/folke/lazy.nvim.git",
|
||||||
"--branch=stable", -- latest stable release
|
"--branch=stable", -- latest stable release
|
||||||
lazypath,
|
lazypath,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
require("lazy").setup({
|
require("lazy").setup({
|
||||||
{
|
{
|
||||||
"nvimdev/dashboard-nvim",
|
"nvimdev/dashboard-nvim",
|
||||||
event = "VimEnter",
|
event = "VimEnter",
|
||||||
opts = function()
|
opts = function()
|
||||||
local logo = [[
|
local logo = [[
|
||||||
██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z
|
██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z
|
||||||
██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██║ ██║██║████╗ ████║ Z
|
██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██║ ██║██║████╗ ████║ Z
|
||||||
██║ ███████║ ███╔╝ ╚████╔╝ ██║ ██║██║██╔████╔██║ z
|
██║ ███████║ ███╔╝ ╚████╔╝ ██║ ██║██║██╔████╔██║ z
|
||||||
|
@ -27,114 +27,120 @@ require("lazy").setup({
|
||||||
╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
|
╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
|
||||||
]]
|
]]
|
||||||
|
|
||||||
logo = string.rep("\n", 8) .. logo .. "\n\n"
|
logo = string.rep("\n", 8) .. logo .. "\n\n"
|
||||||
|
|
||||||
local opts = {
|
local opts = {
|
||||||
theme = "doom",
|
theme = "doom",
|
||||||
hide = {
|
hide = {
|
||||||
-- this is taken care of by lualine
|
-- this is taken care of by lualine
|
||||||
-- enabling this messes up the actual laststatus setting after loading a file
|
-- enabling this messes up the actual laststatus setting after loading a file
|
||||||
statusline = false,
|
statusline = false,
|
||||||
},
|
},
|
||||||
config = {
|
config = {
|
||||||
header = vim.split(logo, "\n"),
|
header = vim.split(logo, "\n"),
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
center = {
|
center = {
|
||||||
-- { action = LazyVim.telescope("files"), desc = " Find File", icon = " ", key = "f" },
|
-- { action = LazyVim.telescope("files"), desc = " Find File", icon = " ", key = "f" },
|
||||||
{ action = "ene | startinsert", desc = " New File", icon = " ", key = "n" },
|
{ action = "ene | startinsert", desc = " New File", icon = " ", key = "n" },
|
||||||
{ action = "Telescope oldfiles", desc = " Recent Files", icon = " ", key = "r" },
|
{ action = "Telescope oldfiles", desc = " Recent Files", icon = " ", key = "r" },
|
||||||
{ action = "Telescope live_grep", desc = " Find Text", icon = " ", key = "g" },
|
{ action = "Telescope live_grep", desc = " Find Text", icon = " ", key = "g" },
|
||||||
{ action = [[lua LazyVim.telescope.config_files()()]], desc = " Config", icon = " ", key = "c" },
|
{ action = [[lua LazyVim.telescope.config_files()()]], desc = " Config", icon = " ", key = "c" },
|
||||||
{ action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" },
|
{ action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" },
|
||||||
{ action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" },
|
{ action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" },
|
||||||
{ action = "Lazy", desc = " Lazy", icon = " ", key = "l" },
|
{ action = "Lazy", desc = " Lazy", icon = " ", key = "l" },
|
||||||
{ action = "qa", desc = " Quit", icon = " ", key = "q" },
|
{ action = "qa", desc = " Quit", icon = " ", key = "q" },
|
||||||
},
|
},
|
||||||
footer = function()
|
footer = function()
|
||||||
local stats = require("lazy").stats()
|
local stats = require("lazy").stats()
|
||||||
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
|
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
|
||||||
return { "⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" }
|
return {
|
||||||
end,
|
"⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms",
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
for _, button in ipairs(opts.config.center) do
|
for _, button in ipairs(opts.config.center) do
|
||||||
button.desc = button.desc .. string.rep(" ", 43 - #button.desc)
|
button.desc = button.desc .. string.rep(" ", 43 - #button.desc)
|
||||||
button.key_format = " %s"
|
button.key_format = " %s"
|
||||||
end
|
end
|
||||||
|
|
||||||
-- close Lazy and re-open when the dashboard is ready
|
-- close Lazy and re-open when the dashboard is ready
|
||||||
if vim.o.filetype == "lazy" then
|
if vim.o.filetype == "lazy" then
|
||||||
vim.cmd.close()
|
vim.cmd.close()
|
||||||
vim.api.nvim_create_autocmd("User", {
|
vim.api.nvim_create_autocmd("User", {
|
||||||
pattern = "DashboardLoaded",
|
pattern = "DashboardLoaded",
|
||||||
callback = function()
|
callback = function()
|
||||||
require("lazy").show()
|
require("lazy").show()
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
return opts
|
return opts
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
"tanvirtin/monokai.nvim",
|
"tanvirtin/monokai.nvim",
|
||||||
{
|
{
|
||||||
"onsails/lspkind.nvim",
|
"onsails/lspkind.nvim",
|
||||||
event = { "VimEnter" },
|
event = { "VimEnter" },
|
||||||
},
|
},
|
||||||
{ "catppuccin/nvim", name = "catppuccin", priority = 1000 },
|
{ "catppuccin/nvim", name = "catppuccin", priority = 1000 },
|
||||||
-- Auto-completion engine
|
-- Auto-completion engine
|
||||||
{
|
{
|
||||||
"hrsh7th/nvim-cmp",
|
"hrsh7th/nvim-cmp",
|
||||||
dependencies = { "lspkind.nvim" },
|
dependencies = { "lspkind.nvim" },
|
||||||
config = function()
|
config = function()
|
||||||
require("config.nvim-cmp")
|
require("config.nvim-cmp")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{ "hrsh7th/cmp-nvim-lsp", dependencies = { "nvim-cmp" } },
|
{ "hrsh7th/cmp-nvim-lsp", dependencies = { "nvim-cmp" } },
|
||||||
{ "hrsh7th/cmp-buffer", dependencies = { "nvim-cmp" } }, -- buffer auto-completion
|
{ "hrsh7th/cmp-buffer", dependencies = { "nvim-cmp" } }, -- buffer auto-completion
|
||||||
{ "hrsh7th/cmp-path", dependencies = { "nvim-cmp" } }, -- path auto-completion
|
{ "hrsh7th/cmp-path", dependencies = { "nvim-cmp" } }, -- path auto-completion
|
||||||
{ "hrsh7th/cmp-cmdline", dependencies = { "nvim-cmp" } }, -- cmdline auto-completion
|
{ "hrsh7th/cmp-cmdline", dependencies = { "nvim-cmp" } }, -- cmdline auto-completion
|
||||||
-- Code snippet engine
|
-- Code snippet engine
|
||||||
{
|
{
|
||||||
"L3MON4D3/LuaSnip",
|
"L3MON4D3/LuaSnip",
|
||||||
version = "v2.*",
|
version = "v2.*",
|
||||||
},
|
},
|
||||||
"williamboman/mason.nvim",
|
"williamboman/mason.nvim",
|
||||||
"williamboman/mason-lspconfig.nvim",
|
"williamboman/mason-lspconfig.nvim",
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
"nvim-tree/nvim-tree.lua",
|
"nvim-tree/nvim-tree.lua",
|
||||||
version = "*",
|
version = "*",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-tree/nvim-web-devicons",
|
"nvim-tree/nvim-web-devicons",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'nvim-telescope/telescope.nvim',
|
"nvim-telescope/telescope.nvim",
|
||||||
tag = '0.1.6',
|
tag = "0.1.6",
|
||||||
dependencies = { 'nvim-lua/plenary.nvim' }
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
},
|
},
|
||||||
'zaldih/themery.nvim',
|
"zaldih/themery.nvim",
|
||||||
'terrortylor/nvim-comment',
|
"terrortylor/nvim-comment",
|
||||||
'szw/vim-maximizer',
|
"szw/vim-maximizer",
|
||||||
{
|
{
|
||||||
'nvim-lualine/lualine.nvim',
|
"nvim-lualine/lualine.nvim",
|
||||||
dependencies = { 'nvim-tree/nvim-web-devicons' }
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
},
|
},
|
||||||
'numToStr/FTerm.nvim',
|
"numToStr/FTerm.nvim",
|
||||||
'github/copilot.vim',
|
"github/copilot.vim",
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
{
|
{
|
||||||
"ThePrimeagen/harpoon",
|
"ThePrimeagen/harpoon",
|
||||||
branch = "harpoon2",
|
branch = "harpoon2",
|
||||||
requires = { { "nvim-lua/plenary.nvim" } }
|
requires = { { "nvim-lua/plenary.nvim" } },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'windwp/nvim-autopairs',
|
"windwp/nvim-autopairs",
|
||||||
event = "InsertEnter",
|
event = "InsertEnter",
|
||||||
config = true
|
config = true,
|
||||||
},
|
},
|
||||||
'windwp/nvim-ts-autotag',
|
"windwp/nvim-ts-autotag",
|
||||||
'nvim-treesitter/nvim-treesitter',
|
"nvim-treesitter/nvim-treesitter",
|
||||||
'mfussenegger/nvim-dap'
|
"mfussenegger/nvim-dap",
|
||||||
|
{
|
||||||
|
"stevearc/conform.nvim",
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue