updated formatting
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
vim.cmd("let g:netrw_liststyle = 3")
|
vim.cmd "let g:netrw_liststyle = 3"
|
||||||
|
|
||||||
local opt = vim.opt
|
local opt = vim.opt
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ opt.wrap = false
|
|||||||
-- search
|
-- search
|
||||||
opt.ignorecase = true
|
opt.ignorecase = true
|
||||||
opt.smartcase = true
|
opt.smartcase = true
|
||||||
opt.iskeyword:append("-") -- consider string-string as a whole word
|
opt.iskeyword:append "-" -- consider string-string as a whole word
|
||||||
|
|
||||||
-- cursor line
|
-- cursor line
|
||||||
opt.cursorline = true
|
opt.cursorline = true
|
||||||
@@ -35,12 +35,13 @@ opt.colorcolumn = "90"
|
|||||||
opt.backspace = "indent,eol,start"
|
opt.backspace = "indent,eol,start"
|
||||||
|
|
||||||
-- clipboard
|
-- clipboard
|
||||||
opt.clipboard:append("unnamedplus") -- use system clipboard as the default register
|
opt.clipboard:append "unnamedplus" -- use system clipboard as the default register
|
||||||
|
|
||||||
-- split windows
|
-- split windows
|
||||||
opt.splitright = true
|
opt.splitright = true
|
||||||
opt.splitbelow = true
|
opt.splitbelow = true
|
||||||
|
|
||||||
-- save me
|
-- save me
|
||||||
opt.undodir = os.getenv("HOME") .. "/.config/nvim/.undo"
|
opt.undodir = os.getenv "HOME" .. "/.config/nvim/.undo"
|
||||||
opt.undofile = true
|
opt.undofile = true
|
||||||
|
opt.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
|
||||||
|
|||||||
@@ -26,10 +26,14 @@ return {
|
|||||||
dashboard.button("SPC ee", " > Toggle file explorer", "<cmd>NvimTreeToggle<CR>"),
|
dashboard.button("SPC ee", " > Toggle file explorer", "<cmd>NvimTreeToggle<CR>"),
|
||||||
dashboard.button("SPC ff", " > Find File", "<cmd>Telescope find_files<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 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>"),
|
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
|
-- Send config to alpha
|
||||||
alpha.setup(dashboard.opts)
|
alpha.setup(dashboard.opts)
|
||||||
|
|
||||||
|
|||||||
@@ -15,13 +15,13 @@ return {
|
|||||||
},
|
},
|
||||||
|
|
||||||
config = function()
|
config = function()
|
||||||
local cmp = require("cmp")
|
local cmp = require "cmp"
|
||||||
local luasnip = require("luasnip")
|
local luasnip = require "luasnip"
|
||||||
local lspkind = require("lspkind")
|
local lspkind = require "lspkind"
|
||||||
|
|
||||||
require("luasnip.loaders.from_vscode").lazy_load()
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
|
|
||||||
cmp.setup({
|
cmp.setup {
|
||||||
completion = {
|
completion = {
|
||||||
completeopt = "menu,menuone,preview,noselect",
|
completeopt = "menu,menuone,preview,noselect",
|
||||||
},
|
},
|
||||||
@@ -30,27 +30,30 @@ return {
|
|||||||
luasnip.lsp_expand(args.body)
|
luasnip.lsp_expand(args.body)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
mapping = cmp.mapping.preset.insert({
|
mapping = cmp.mapping.preset.insert {
|
||||||
["<C-k>"] = cmp.mapping.select_prev_item(),
|
["<C-k>"] = cmp.mapping.select_prev_item(),
|
||||||
["<C-j>"] = cmp.mapping.select_next_item(),
|
["<C-j>"] = cmp.mapping.select_next_item(),
|
||||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||||
["<C-Space>"] = cmp.mapping.complete(),
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
["<C-e>"] = cmp.mapping.abort(),
|
["<C-e>"] = cmp.mapping.abort(),
|
||||||
["<CR>"] = cmp.mapping.confirm({ select = false }),
|
["<CR>"] = cmp.mapping.confirm { select = false },
|
||||||
}),
|
},
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources {
|
||||||
{ name = "nvim_lsp" },
|
{ name = "nvim_lsp" },
|
||||||
{ name = "luasnip" },
|
{ name = "luasnip" },
|
||||||
{ name = "buffer" },
|
{ name = "buffer" },
|
||||||
{ name = "path" },
|
{ name = "path" },
|
||||||
}),
|
},
|
||||||
formatting = {
|
formatting = {
|
||||||
format = lspkind.cmp_format({
|
format = lspkind.cmp_format {
|
||||||
|
mode = "text",
|
||||||
|
preset = "codeicons",
|
||||||
maxwidth = 50,
|
maxwidth = 50,
|
||||||
ellipsis_char = "...",
|
ellipsis_char = "...",
|
||||||
}),
|
show_labelDetails = false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
})
|
}
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
return {
|
return {
|
||||||
"stevearc/conform.nvim",
|
"stevearc/conform.nvim",
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
|
|
||||||
config = function()
|
config = function()
|
||||||
local conform = require("conform")
|
local conform = require "conform"
|
||||||
|
|
||||||
conform.setup({
|
conform.setup {
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
javascript = { "prettier" },
|
javascript = { "prettier" },
|
||||||
typescript = { "prettier" },
|
typescript = { "prettier" },
|
||||||
@@ -27,14 +26,14 @@ return {
|
|||||||
async = false,
|
async = false,
|
||||||
timeout_ms = 1000,
|
timeout_ms = 1000,
|
||||||
},
|
},
|
||||||
})
|
}
|
||||||
|
|
||||||
vim.keymap.set({ "n", "v" }, "<leader>mp", function()
|
vim.keymap.set({ "n", "v" }, "<leader>mp", function()
|
||||||
conform.format({
|
conform.format {
|
||||||
lsp_fallback = true,
|
lsp_fallback = true,
|
||||||
async = false,
|
async = false,
|
||||||
timeout_ms = 1000,
|
timeout_ms = 1000,
|
||||||
})
|
}
|
||||||
end, { desc = "Format file or range (in visual mode)" })
|
end, { desc = "Format file or range (in visual mode)" })
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,55 +6,56 @@ return {
|
|||||||
"windwp/nvim-ts-autotag",
|
"windwp/nvim-ts-autotag",
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local treesitter = require("nvim-treesitter.configs")
|
local treesitter = require "nvim-treesitter.configs"
|
||||||
|
|
||||||
treesitter.setup({
|
treesitter.setup {
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
},
|
},
|
||||||
indent = { enable = true },
|
indent = { enable = true },
|
||||||
autotag = { enable = true },
|
autotag = { enable = true },
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"bash",
|
"bash",
|
||||||
"cmake",
|
"cmake",
|
||||||
"cpp",
|
"cpp",
|
||||||
"css",
|
"css",
|
||||||
"diff",
|
"diff",
|
||||||
"dockerfile",
|
"dockerfile",
|
||||||
"git_config",
|
"git_config",
|
||||||
"git_rebase",
|
"git_rebase",
|
||||||
"gitcommit",
|
"gitcommit",
|
||||||
"gitignore",
|
"gitignore",
|
||||||
"graphql",
|
"graphql",
|
||||||
"html",
|
"html",
|
||||||
"javascript",
|
"javascript",
|
||||||
"json",
|
"json",
|
||||||
"lua",
|
"lua",
|
||||||
"markdown",
|
"markdown",
|
||||||
"markdown_inline",
|
"markdown_inline",
|
||||||
"nginx",
|
"nginx",
|
||||||
"perl",
|
"perl",
|
||||||
"php",
|
"php",
|
||||||
"python",
|
"python",
|
||||||
"regex",
|
"regex",
|
||||||
"sql",
|
"sql",
|
||||||
"ssh_config",
|
"ssh_config",
|
||||||
"todotxt",
|
"todotxt",
|
||||||
"typescript",
|
"typescript",
|
||||||
"vim",
|
"vim",
|
||||||
"xml",
|
"vimdoc",
|
||||||
"yaml",
|
"xml",
|
||||||
},
|
"yaml",
|
||||||
auto_install = true,
|
},
|
||||||
incremental_selection = {
|
auto_install = true,
|
||||||
enable = true,
|
incremental_selection = {
|
||||||
keymaps = {
|
enable = true,
|
||||||
init_selection = "<C-space>",
|
keymaps = {
|
||||||
node_incremental = "<C-space>",
|
init_selection = "<C-space>",
|
||||||
scope_incremental = false,
|
node_incremental = "<C-space>",
|
||||||
node_decremental = "<bs>",
|
scope_incremental = false,
|
||||||
},
|
node_decremental = "<bs>",
|
||||||
},
|
},
|
||||||
})
|
},
|
||||||
end,
|
}
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user