Adds my basic setup
This commit is contained in:
parent
9b256d9368
commit
fd947ffd03
7 changed files with 203 additions and 11 deletions
15
lua/custom/plugins/autopairs.lua
Normal file
15
lua/custom/plugins/autopairs.lua
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
return {
|
||||
"windwp/nvim-autopairs",
|
||||
-- Optional dependency
|
||||
dependencies = { 'hrsh7th/nvim-cmp' },
|
||||
config = function()
|
||||
require("nvim-autopairs").setup {}
|
||||
-- If you want to automatically add `(` after selecting a function or method
|
||||
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
|
||||
local cmp = require('cmp')
|
||||
cmp.event:on(
|
||||
'confirm_done',
|
||||
cmp_autopairs.on_confirm_done()
|
||||
)
|
||||
end,
|
||||
}
|
||||
3
lua/custom/plugins/devicons.lua
Normal file
3
lua/custom/plugins/devicons.lua
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
return {
|
||||
"nvim-tree/nvim-web-devicons", lazy = true
|
||||
}
|
||||
26
lua/custom/plugins/filetree.lua
Normal file
26
lua/custom/plugins/filetree.lua
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
return {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
version = "*",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
config = function()
|
||||
require('neo-tree').setup {
|
||||
filesystem = {
|
||||
filtered_items = {
|
||||
visible = true,
|
||||
hide_dotfiles = false,
|
||||
hide_gitignored = true,
|
||||
hide_by_name = {
|
||||
-- '.git',
|
||||
-- '.DS_Store',
|
||||
-- 'thumbs.db',
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
vim.keymap.set('n', '<leader>e', '<Cmd>Neotree toggle<CR>', { desc = 'Open filetree explorer' })
|
||||
end,
|
||||
}
|
||||
38
lua/custom/plugins/formatting.lua
Normal file
38
lua/custom/plugins/formatting.lua
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
return {
|
||||
"stevearc/conform.nvim",
|
||||
lazy = true,
|
||||
event = { "BufReadPre", "BufNewFile" }, -- to disable comment this out
|
||||
config = function()
|
||||
local conform = require("conform")
|
||||
|
||||
conform.setup({
|
||||
formatters_by_ft = {
|
||||
css = { { --[[ "prettierd", ]] "prettier" } },
|
||||
graphql = { { --[[ "prettierd", ]] "prettier" } },
|
||||
html = { { --[[ "prettierd", ]] "prettier" } },
|
||||
javascript = { { --[[ "prettierd", ]] "prettier" } },
|
||||
javascriptreact = { { --[[ "prettierd", ]] "prettier" } },
|
||||
json = { { --[[ "prettierd", ]] "prettier" } },
|
||||
less = { { --[[ "prettierd", ]] "prettier" } },
|
||||
markdown = { { --[[ "prettierd", ]] "prettier" } },
|
||||
scss = { { --[[ "prettierd", ]] "prettier" } },
|
||||
svelte = { { --[[ "prettierd", ]] "prettier" } },
|
||||
typescript = { { --[[ "prettierd", ]] "prettier" } },
|
||||
typescriptreact = { { --[[ "prettierd", ]] "prettier" } },
|
||||
yaml = { { --[[ "prettierd", ]] "prettier" } },
|
||||
},
|
||||
format_on_save = {
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 500
|
||||
}
|
||||
})
|
||||
vim.keymap.set({ "n", "v" }, "<leader>f", function()
|
||||
conform.format({
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 1000,
|
||||
})
|
||||
end, { desc = "Format file or range (in visual mode)" })
|
||||
end
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue