updated formatting
This commit is contained in:
@@ -26,10 +26,14 @@ return {
|
||||
dashboard.button("SPC ee", " > Toggle file explorer", "<cmd>NvimTreeToggle<CR>"),
|
||||
dashboard.button("SPC ff", " > Find File", "<cmd>Telescope find_files<CR>"),
|
||||
dashboard.button("SPC fs", " > Find Word", "<cmd>Telescope live_grep<CR>"),
|
||||
dashboard.button("SPC wr", " > Restore Session For Current Directory", "<cmd>SessionRestore<CR>"),
|
||||
dashboard.button("SPC wl", " > Restore a Previous Session", "<cmd>SessionSearch<CR>"),
|
||||
dashboard.button("q", " > Quit NVIM", "<cmd>qa<CR>"),
|
||||
}
|
||||
|
||||
local handle = io.popen "fortune"
|
||||
local fortune = handle:read "*a"
|
||||
handle:close()
|
||||
dashboard.section.footer.val = fortune
|
||||
-- Send config to alpha
|
||||
alpha.setup(dashboard.opts)
|
||||
|
||||
|
||||
@@ -15,13 +15,13 @@ return {
|
||||
},
|
||||
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
local lspkind = require("lspkind")
|
||||
local cmp = require "cmp"
|
||||
local luasnip = require "luasnip"
|
||||
local lspkind = require "lspkind"
|
||||
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
|
||||
cmp.setup({
|
||||
cmp.setup {
|
||||
completion = {
|
||||
completeopt = "menu,menuone,preview,noselect",
|
||||
},
|
||||
@@ -30,27 +30,30 @@ return {
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
mapping = cmp.mapping.preset.insert {
|
||||
["<C-k>"] = cmp.mapping.select_prev_item(),
|
||||
["<C-j>"] = cmp.mapping.select_next_item(),
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = false }),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
["<CR>"] = cmp.mapping.confirm { select = false },
|
||||
},
|
||||
sources = cmp.config.sources {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
}),
|
||||
},
|
||||
formatting = {
|
||||
format = lspkind.cmp_format({
|
||||
format = lspkind.cmp_format {
|
||||
mode = "text",
|
||||
preset = "codeicons",
|
||||
maxwidth = 50,
|
||||
ellipsis_char = "...",
|
||||
}),
|
||||
show_labelDetails = false,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
return {
|
||||
"stevearc/conform.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
|
||||
config = function()
|
||||
local conform = require("conform")
|
||||
local conform = require "conform"
|
||||
|
||||
conform.setup({
|
||||
conform.setup {
|
||||
formatters_by_ft = {
|
||||
javascript = { "prettier" },
|
||||
typescript = { "prettier" },
|
||||
@@ -27,14 +26,14 @@ return {
|
||||
async = false,
|
||||
timeout_ms = 1000,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
vim.keymap.set({ "n", "v" }, "<leader>mp", function()
|
||||
conform.format({
|
||||
conform.format {
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 1000,
|
||||
})
|
||||
}
|
||||
end, { desc = "Format file or range (in visual mode)" })
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -6,55 +6,56 @@ return {
|
||||
"windwp/nvim-ts-autotag",
|
||||
},
|
||||
config = function()
|
||||
local treesitter = require("nvim-treesitter.configs")
|
||||
local treesitter = require "nvim-treesitter.configs"
|
||||
|
||||
treesitter.setup({
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
indent = { enable = true },
|
||||
autotag = { enable = true },
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"cmake",
|
||||
"cpp",
|
||||
"css",
|
||||
"diff",
|
||||
"dockerfile",
|
||||
"git_config",
|
||||
"git_rebase",
|
||||
"gitcommit",
|
||||
"gitignore",
|
||||
"graphql",
|
||||
"html",
|
||||
"javascript",
|
||||
"json",
|
||||
"lua",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"nginx",
|
||||
"perl",
|
||||
"php",
|
||||
"python",
|
||||
"regex",
|
||||
"sql",
|
||||
"ssh_config",
|
||||
"todotxt",
|
||||
"typescript",
|
||||
"vim",
|
||||
"xml",
|
||||
"yaml",
|
||||
},
|
||||
auto_install = true,
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<C-space>",
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = false,
|
||||
node_decremental = "<bs>",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
treesitter.setup {
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
indent = { enable = true },
|
||||
autotag = { enable = true },
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"cmake",
|
||||
"cpp",
|
||||
"css",
|
||||
"diff",
|
||||
"dockerfile",
|
||||
"git_config",
|
||||
"git_rebase",
|
||||
"gitcommit",
|
||||
"gitignore",
|
||||
"graphql",
|
||||
"html",
|
||||
"javascript",
|
||||
"json",
|
||||
"lua",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"nginx",
|
||||
"perl",
|
||||
"php",
|
||||
"python",
|
||||
"regex",
|
||||
"sql",
|
||||
"ssh_config",
|
||||
"todotxt",
|
||||
"typescript",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"xml",
|
||||
"yaml",
|
||||
},
|
||||
auto_install = true,
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<C-space>",
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = false,
|
||||
node_decremental = "<bs>",
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user