Add support for more formatter's, stylua config.
This commit is contained in:
parent
24f7bb50b6
commit
ccc9ffa2db
@ -1,44 +1,44 @@
|
|||||||
require("nvim-autopairs").setup {}
|
require("nvim-autopairs").setup({})
|
||||||
|
|
||||||
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 handlers = require('nvim-autopairs.completion.handlers')
|
local handlers = require("nvim-autopairs.completion.handlers")
|
||||||
|
|
||||||
cmp.event:on(
|
cmp.event:on(
|
||||||
'confirm_done',
|
"confirm_done",
|
||||||
cmp_autopairs.on_confirm_done({
|
cmp_autopairs.on_confirm_done({
|
||||||
filetypes = {
|
filetypes = {
|
||||||
-- "*" is a alias to all filetypes
|
-- "*" is a alias to all filetypes
|
||||||
["*"] = {
|
["*"] = {
|
||||||
["("] = {
|
["("] = {
|
||||||
kind = {
|
kind = {
|
||||||
cmp.lsp.CompletionItemKind.Function,
|
cmp.lsp.CompletionItemKind.Function,
|
||||||
cmp.lsp.CompletionItemKind.Method,
|
cmp.lsp.CompletionItemKind.Method,
|
||||||
},
|
},
|
||||||
handler = handlers["*"]
|
handler = handlers["*"],
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
lua = {
|
lua = {
|
||||||
["("] = {
|
["("] = {
|
||||||
kind = {
|
kind = {
|
||||||
cmp.lsp.CompletionItemKind.Function,
|
cmp.lsp.CompletionItemKind.Function,
|
||||||
cmp.lsp.CompletionItemKind.Method
|
cmp.lsp.CompletionItemKind.Method,
|
||||||
},
|
},
|
||||||
---@param char string
|
---@param char string
|
||||||
---@param item table item completion
|
---@param item table item completion
|
||||||
---@param bufnr number buffer number
|
---@param bufnr number buffer number
|
||||||
---@param rules table
|
---@param rules table
|
||||||
---@param commit_character table<string>
|
---@param commit_character table<string>
|
||||||
handler = function(char, item, bufnr, rules, commit_character)
|
handler = function(char, item, bufnr, rules, commit_character)
|
||||||
-- Your handler function. Inpect with print(vim.inspect{char, item, bufnr, rules, commit_character})
|
-- Your handler function. Inpect with print(vim.inspect{char, item, bufnr, rules, commit_character})
|
||||||
end
|
end,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
-- Disable for tex
|
-- Disable for tex
|
||||||
tex = false,
|
tex = false,
|
||||||
sh = false,
|
sh = false,
|
||||||
bash = false,
|
bash = false,
|
||||||
zsh = false,
|
zsh = false,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
@ -1,57 +1,57 @@
|
|||||||
require("catppuccin").setup({
|
require("catppuccin").setup({
|
||||||
flavour = "frappe",
|
flavour = "frappe",
|
||||||
styles = {
|
styles = {
|
||||||
comments = { "italic" },
|
comments = { "italic" },
|
||||||
conditionals = { "italic" },
|
conditionals = { "italic" },
|
||||||
loops = {},
|
loops = {},
|
||||||
functions = { "bold" },
|
functions = { "bold" },
|
||||||
keywords = { "bold" },
|
keywords = { "bold" },
|
||||||
strings = {},
|
strings = {},
|
||||||
variables = {},
|
variables = {},
|
||||||
numbers = {},
|
numbers = {},
|
||||||
booleans = {},
|
booleans = {},
|
||||||
properties = {},
|
properties = {},
|
||||||
types = {},
|
types = {},
|
||||||
operators = {},
|
operators = {},
|
||||||
},
|
},
|
||||||
integrations = {
|
integrations = {
|
||||||
cmp = true,
|
cmp = true,
|
||||||
gitsigns = true,
|
gitsigns = true,
|
||||||
harpoon = true,
|
harpoon = true,
|
||||||
indent_blankline = {
|
indent_blankline = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
},
|
},
|
||||||
markdown = true,
|
markdown = true,
|
||||||
mason = true,
|
mason = true,
|
||||||
mini = {
|
mini = {
|
||||||
enabled = true
|
enabled = true,
|
||||||
},
|
},
|
||||||
dap = {
|
dap = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
},
|
},
|
||||||
native_lsp = {
|
native_lsp = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
virtual_text = {
|
virtual_text = {
|
||||||
errors = { "italic" },
|
errors = { "italic" },
|
||||||
hints = { "italic" },
|
hints = { "italic" },
|
||||||
warnings = { "italic" },
|
warnings = { "italic" },
|
||||||
information = { "italic" },
|
information = { "italic" },
|
||||||
},
|
},
|
||||||
underlines = {
|
underlines = {
|
||||||
errors = { "undercurl" },
|
errors = { "undercurl" },
|
||||||
hints = { "undercurl" },
|
hints = { "undercurl" },
|
||||||
warnings = { "undercurl" },
|
warnings = { "undercurl" },
|
||||||
information = { "undercurl" },
|
information = { "undercurl" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
notify = true,
|
notify = true,
|
||||||
telescope = {
|
telescope = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
},
|
},
|
||||||
treesitter = true,
|
treesitter = true,
|
||||||
which_key = true,
|
which_key = true,
|
||||||
fidget = true,
|
fidget = true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.cmd.colorscheme 'catppuccin'
|
vim.cmd.colorscheme("catppuccin")
|
||||||
|
@ -1,25 +1,25 @@
|
|||||||
require("colorizer").setup({
|
require("colorizer").setup({
|
||||||
filetypes = { "*" },
|
filetypes = { "*" },
|
||||||
user_default_options = {
|
user_default_options = {
|
||||||
RGB = true, -- #RGB hex codes
|
RGB = true, -- #RGB hex codes
|
||||||
RRGGBB = true, -- #RRGGBB hex codes
|
RRGGBB = true, -- #RRGGBB hex codes
|
||||||
names = false, -- "Name" codes like Blue or blue
|
names = false, -- "Name" codes like Blue or blue
|
||||||
RRGGBBAA = true, -- #RRGGBBAA hex codes
|
RRGGBBAA = true, -- #RRGGBBAA hex codes
|
||||||
AARRGGBB = true, -- 0xAARRGGBB hex codes
|
AARRGGBB = true, -- 0xAARRGGBB hex codes
|
||||||
rgb_fn = true, -- CSS rgb() and rgba() functions
|
rgb_fn = true, -- CSS rgb() and rgba() functions
|
||||||
hsl_fn = true, -- CSS hsl() and hsla() functions
|
hsl_fn = true, -- CSS hsl() and hsla() functions
|
||||||
css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
|
css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
|
||||||
css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn
|
css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn
|
||||||
-- Available modes for `mode`: foreground, background, virtualtext
|
-- Available modes for `mode`: foreground, background, virtualtext
|
||||||
mode = "background", -- Set the display mode.
|
mode = "background", -- Set the display mode.
|
||||||
-- Available methods are false / true / "normal" / "lsp" / "both"
|
-- Available methods are false / true / "normal" / "lsp" / "both"
|
||||||
-- True is same as normal
|
-- True is same as normal
|
||||||
tailwind = false, -- Enable tailwind colors
|
tailwind = false, -- Enable tailwind colors
|
||||||
-- parsers can contain values used in |user_default_options|
|
-- parsers can contain values used in |user_default_options|
|
||||||
sass = { enable = false, parsers = { "css" } }, -- Enable sass colors
|
sass = { enable = false, parsers = { "css" } }, -- Enable sass colors
|
||||||
virtualtext = "■",
|
virtualtext = "■",
|
||||||
-- update color values even if buffer is not focused
|
-- update color values even if buffer is not focused
|
||||||
-- example use: cmp_menu, cmp_docs
|
-- example use: cmp_menu, cmp_docs
|
||||||
always_update = true,
|
always_update = true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
14
after/plugin/conform.lua
Normal file
14
after/plugin/conform.lua
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
local conform = require("conform")
|
||||||
|
|
||||||
|
conform.setup({
|
||||||
|
formatters_by_ft = {
|
||||||
|
python = { "isort", "black" },
|
||||||
|
lua = { "stylua" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.keymap.set({ "n", "v" }, "<leader>f", function()
|
||||||
|
conform.format({
|
||||||
|
lsp_fallback = true,
|
||||||
|
})
|
||||||
|
end, { desc = "Format file or range (in visual mode)" })
|
@ -1,27 +1,27 @@
|
|||||||
vim.keymap.set("n", "<leader>gs", vim.cmd.Git, {desc = "Git status"})
|
vim.keymap.set("n", "<leader>gs", vim.cmd.Git, { desc = "Git status" })
|
||||||
|
|
||||||
local Crony_Fugitive = vim.api.nvim_create_augroup("Crony_Fugitive", {})
|
local Crony_Fugitive = vim.api.nvim_create_augroup("Crony_Fugitive", {})
|
||||||
|
|
||||||
local autocmd = vim.api.nvim_create_autocmd
|
local autocmd = vim.api.nvim_create_autocmd
|
||||||
autocmd("BufWinEnter", {
|
autocmd("BufWinEnter", {
|
||||||
group = Crony_Fugitive,
|
group = Crony_Fugitive,
|
||||||
pattern = "*",
|
pattern = "*",
|
||||||
callback = function()
|
callback = function()
|
||||||
if vim.bo.ft ~= "fugitive" then
|
if vim.bo.ft ~= "fugitive" then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local bufnr = vim.api.nvim_get_current_buf()
|
local bufnr = vim.api.nvim_get_current_buf()
|
||||||
local opts = {buffer = bufnr, remap = false}
|
local opts = { buffer = bufnr, remap = false }
|
||||||
vim.keymap.set("n", "<leader>p", function()
|
vim.keymap.set("n", "<leader>p", function()
|
||||||
vim.cmd.Git('push')
|
vim.cmd.Git("push")
|
||||||
end, opts)
|
end, opts)
|
||||||
|
|
||||||
-- rebase always
|
-- rebase always
|
||||||
vim.keymap.set("n", "<leader>P", function()
|
vim.keymap.set("n", "<leader>P", function()
|
||||||
vim.cmd.Git({'pull', '--rebase'})
|
vim.cmd.Git({ "pull", "--rebase" })
|
||||||
end, opts)
|
end, opts)
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>t", ":Git push -u origin ", opts);
|
vim.keymap.set("n", "<leader>t", ":Git push -u origin ", opts)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
require("gitsigns").setup({
|
require("gitsigns").setup({
|
||||||
signs = {
|
signs = {
|
||||||
add = { text = "▎" },
|
add = { text = "▎" },
|
||||||
change = { text = "▎" },
|
change = { text = "▎" },
|
||||||
delete = { text = "▎" },
|
delete = { text = "▎" },
|
||||||
topdelete = { text = "▎" },
|
topdelete = { text = "▎" },
|
||||||
changedelete = { text = "▎" },
|
changedelete = { text = "▎" },
|
||||||
untracked = { text = "▎" },
|
untracked = { text = "▎" },
|
||||||
},
|
},
|
||||||
on_attach = function(buffer)
|
on_attach = function(buffer)
|
||||||
local gs = package.loaded.gitsigns
|
local gs = package.loaded.gitsigns
|
||||||
|
|
||||||
local function map(mode, l, r, desc)
|
local function map(mode, l, r, desc)
|
||||||
vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc })
|
vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc })
|
||||||
end
|
end
|
||||||
|
|
||||||
-- stylua: ignore start
|
-- stylua: ignore start
|
||||||
map("n", "]g", gs.next_hunk, "Next git hunk")
|
map("n", "]g", gs.next_hunk, "Next git hunk")
|
||||||
map("n", "[g", gs.prev_hunk, "Previous git hunk")
|
map("n", "[g", gs.prev_hunk, "Previous git hunk")
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
@ -4,14 +4,30 @@ local harpoon = require("harpoon")
|
|||||||
harpoon:setup()
|
harpoon:setup()
|
||||||
-- REQUIRED
|
-- REQUIRED
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>a", function() harpoon:list():append() end, {desc = "Append file to harpoon starred list"})
|
vim.keymap.set("n", "<leader>a", function()
|
||||||
vim.keymap.set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end, {desc = "Check the list of files in harpoon"})
|
harpoon:list():append()
|
||||||
|
end, { desc = "Append file to harpoon starred list" })
|
||||||
|
vim.keymap.set("n", "<C-e>", function()
|
||||||
|
harpoon.ui:toggle_quick_menu(harpoon:list())
|
||||||
|
end, { desc = "Check the list of files in harpoon" })
|
||||||
|
|
||||||
vim.keymap.set("n", "<C-j>", function() harpoon:list():select(1) end, {desc = "Harpoon to 1st file in list"})
|
vim.keymap.set("n", "<C-j>", function()
|
||||||
vim.keymap.set("n", "<C-k>", function() harpoon:list():select(2) end, {desc = "Harpoon to 2nd file in list"})
|
harpoon:list():select(1)
|
||||||
vim.keymap.set("n", "<C-l>", function() harpoon:list():select(3) end, {desc = "Harpoon to 3rd file in list"})
|
end, { desc = "Harpoon to 1st file in list" })
|
||||||
vim.keymap.set("n", "<C-;>", function() harpoon:list():select(4) end, {desc = "Harpoon to 4th file in list"})
|
vim.keymap.set("n", "<C-k>", function()
|
||||||
|
harpoon:list():select(2)
|
||||||
|
end, { desc = "Harpoon to 2nd file in list" })
|
||||||
|
vim.keymap.set("n", "<C-l>", function()
|
||||||
|
harpoon:list():select(3)
|
||||||
|
end, { desc = "Harpoon to 3rd file in list" })
|
||||||
|
vim.keymap.set("n", "<C-;>", function()
|
||||||
|
harpoon:list():select(4)
|
||||||
|
end, { desc = "Harpoon to 4th file in list" })
|
||||||
|
|
||||||
-- Toggle previous & next buffers stored within Harpoon list
|
-- Toggle previous & next buffers stored within Harpoon list
|
||||||
vim.keymap.set("n", "<C-S-J>", function() harpoon:list():prev() end, {desc = "Harpoon to previous file in list"})
|
vim.keymap.set("n", "<C-S-J>", function()
|
||||||
vim.keymap.set("n", "<C-S-K>", function() harpoon:list():next() end, {desc = "Harpoon to next file in list"})
|
harpoon:list():prev()
|
||||||
|
end, { desc = "Harpoon to previous file in list" })
|
||||||
|
vim.keymap.set("n", "<C-S-K>", function()
|
||||||
|
harpoon:list():next()
|
||||||
|
end, { desc = "Harpoon to next file in list" })
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
require("ibl").setup({
|
require("ibl").setup({
|
||||||
indent = { char = "│" },
|
indent = { char = "│" },
|
||||||
scope = { enabled = false },
|
scope = { enabled = false },
|
||||||
exclude = {
|
exclude = {
|
||||||
filetypes = {
|
filetypes = {
|
||||||
"help",
|
"help",
|
||||||
"alpha",
|
"alpha",
|
||||||
"dashboard",
|
"dashboard",
|
||||||
"neo-tree",
|
"neo-tree",
|
||||||
"Trouble",
|
"Trouble",
|
||||||
"lazy",
|
"lazy",
|
||||||
"mason",
|
"mason",
|
||||||
"notify",
|
"notify",
|
||||||
"toggleterm",
|
"toggleterm",
|
||||||
"lazyterm",
|
"lazyterm",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -1,62 +1,82 @@
|
|||||||
local lsp = require("lsp-zero")
|
local lsp = require("lsp-zero")
|
||||||
|
|
||||||
lsp.extend_cmp()
|
lsp.extend_cmp()
|
||||||
local cmp = require('cmp')
|
local cmp = require("cmp")
|
||||||
|
|
||||||
cmp.setup({
|
cmp.setup({
|
||||||
window = {
|
window = {
|
||||||
completion = cmp.config.window.bordered(),
|
completion = cmp.config.window.bordered(),
|
||||||
documentation = cmp.config.window.bordered(),
|
documentation = cmp.config.window.bordered(),
|
||||||
},
|
},
|
||||||
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-l>'] = cmp.mapping.confirm({ select = true }),
|
["<C-l>"] = cmp.mapping.confirm({ select = true }),
|
||||||
["<C-Space>"] = cmp.mapping.complete(),
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
['<Tab>'] = nil,
|
["<Tab>"] = nil,
|
||||||
['<S-Tab>'] = nil,
|
["<S-Tab>"] = nil,
|
||||||
}),
|
}),
|
||||||
sources = {
|
sources = {
|
||||||
{ name = 'nvim_lsp' },
|
{ name = "nvim_lsp" },
|
||||||
{ name = 'buffer' },
|
{ name = "buffer" },
|
||||||
{ name = 'path' },
|
{ name = "path" },
|
||||||
{ name = 'nvim_lua' },
|
{ name = "nvim_lua" },
|
||||||
{ name = 'luasnip' },
|
{ name = "luasnip" },
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
lsp.set_sign_icons({
|
lsp.set_sign_icons({
|
||||||
error = 'E',
|
error = "E",
|
||||||
warn = 'W',
|
warn = "W",
|
||||||
hint = 'H',
|
hint = "H",
|
||||||
info = 'I'
|
info = "I",
|
||||||
})
|
})
|
||||||
|
|
||||||
lsp.extend_lspconfig()
|
lsp.extend_lspconfig()
|
||||||
|
|
||||||
lsp.on_attach(function(client, bufnr)
|
lsp.on_attach(function(client, bufnr)
|
||||||
local opts = { buffer = bufnr, remap = false }
|
local opts = { buffer = bufnr, remap = false }
|
||||||
|
|
||||||
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
|
vim.keymap.set("n", "gd", function()
|
||||||
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
|
vim.lsp.buf.definition()
|
||||||
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
|
end, opts)
|
||||||
vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts)
|
vim.keymap.set("n", "K", function()
|
||||||
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
|
vim.lsp.buf.hover()
|
||||||
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
|
end, opts)
|
||||||
vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts)
|
vim.keymap.set("n", "<leader>vws", function()
|
||||||
vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts)
|
vim.lsp.buf.workspace_symbol()
|
||||||
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
|
end, opts)
|
||||||
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
|
vim.keymap.set("n", "<leader>vd", function()
|
||||||
|
vim.diagnostic.open_float()
|
||||||
|
end, opts)
|
||||||
|
vim.keymap.set("n", "[d", function()
|
||||||
|
vim.diagnostic.goto_next()
|
||||||
|
end, opts)
|
||||||
|
vim.keymap.set("n", "]d", function()
|
||||||
|
vim.diagnostic.goto_prev()
|
||||||
|
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.references()
|
||||||
|
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)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
vim.diagnostic.config({
|
vim.diagnostic.config({
|
||||||
virtual_text = true
|
virtual_text = true,
|
||||||
})
|
})
|
||||||
|
|
||||||
require("mason").setup({})
|
require("mason").setup({})
|
||||||
require("mason-lspconfig").setup({
|
require("mason-lspconfig").setup({
|
||||||
ensure_installed = { 'lua_ls' },
|
ensure_installed = { "lua_ls" },
|
||||||
handlers = {
|
handlers = {
|
||||||
lsp.default_setup,
|
lsp.default_setup,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
@ -1,22 +1,22 @@
|
|||||||
require('mini.indentscope').setup({
|
require("mini.indentscope").setup({
|
||||||
symbol = "│",
|
symbol = "│",
|
||||||
options = { try_as_border = true },
|
options = { try_as_border = true },
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
pattern = {
|
pattern = {
|
||||||
"help",
|
"help",
|
||||||
"alpha",
|
"alpha",
|
||||||
"dashboard",
|
"dashboard",
|
||||||
"neo-tree",
|
"neo-tree",
|
||||||
"Trouble",
|
"Trouble",
|
||||||
"lazy",
|
"lazy",
|
||||||
"mason",
|
"mason",
|
||||||
"notify",
|
"notify",
|
||||||
"toggleterm",
|
"toggleterm",
|
||||||
"lazyterm",
|
"lazyterm",
|
||||||
},
|
},
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.b.miniindentscope_disable = true
|
vim.b.miniindentscope_disable = true
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
require("mkdnflow").setup({
|
require("mkdnflow").setup({
|
||||||
modules = {
|
modules = {
|
||||||
bib = false,
|
bib = false,
|
||||||
yaml = false,
|
yaml = false,
|
||||||
cmp = false,
|
cmp = false,
|
||||||
},
|
},
|
||||||
links = {
|
links = {
|
||||||
conceal = true,
|
conceal = true,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
require("oil").setup({
|
require("oil").setup({
|
||||||
view_options = {
|
view_options = {
|
||||||
show_hidden = true
|
show_hidden = true,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>e", "<CMD>Oil<CR>", { desc = "Open parent directory" })
|
vim.keymap.set("n", "<leader>e", "<CMD>Oil<CR>", { desc = "Open parent directory" })
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
local builtin = require('telescope.builtin')
|
local builtin = require("telescope.builtin")
|
||||||
vim.keymap.set('n', '<leader>pf', builtin.find_files, { desc = "Find files" })
|
vim.keymap.set("n", "<leader>pf", builtin.find_files, { desc = "Find files" })
|
||||||
vim.keymap.set('n', '<C-p>', builtin.git_files, { desc = "Find git files" })
|
vim.keymap.set("n", "<C-p>", builtin.git_files, { desc = "Find git files" })
|
||||||
vim.keymap.set('n', '<leader>ps', function()
|
vim.keymap.set("n", "<leader>ps", function()
|
||||||
builtin.grep_string({ search = vim.fn.input("Grep > ") })
|
builtin.grep_string({ search = vim.fn.input("Grep > ") })
|
||||||
end, { desc = "Find string" })
|
end, { desc = "Find string" })
|
||||||
vim.keymap.set('n', '<leader>vh', builtin.help_tags, { desc = "Find help tags" })
|
vim.keymap.set("n", "<leader>vh", builtin.help_tags, { desc = "Find help tags" })
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
require 'nvim-treesitter.configs'.setup {
|
require("nvim-treesitter.configs").setup({
|
||||||
ensure_installed = { "lua", "bash" },
|
ensure_installed = { "lua", "bash" },
|
||||||
sync_install = false,
|
sync_install = false,
|
||||||
auto_install = true,
|
auto_install = true,
|
||||||
|
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
additional_vim_regex_highlighting = false,
|
additional_vim_regex_highlighting = false,
|
||||||
},
|
},
|
||||||
}
|
})
|
||||||
|
@ -1,29 +1,29 @@
|
|||||||
require('crony.set')
|
require("crony.set")
|
||||||
require('crony.map')
|
require("crony.map")
|
||||||
require('crony.lazy')
|
require("crony.lazy")
|
||||||
|
|
||||||
local autocmd = vim.api.nvim_create_autocmd
|
local autocmd = vim.api.nvim_create_autocmd
|
||||||
|
|
||||||
local function augroup(name)
|
local function augroup(name)
|
||||||
return vim.api.nvim_create_augroup("crony_" .. name, { clear = true })
|
return vim.api.nvim_create_augroup("crony_" .. name, { clear = true })
|
||||||
end
|
end
|
||||||
|
|
||||||
-- [[ Highlight on yank ]]
|
-- [[ Highlight on yank ]]
|
||||||
autocmd("TextYankPost", {
|
autocmd("TextYankPost", {
|
||||||
group = augroup("highlight_yank"),
|
group = augroup("highlight_yank"),
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.highlight.on_yank()
|
vim.highlight.on_yank()
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- [[ Auto create parent directory if it doesn't exist ]]
|
-- [[ Auto create parent directory if it doesn't exist ]]
|
||||||
autocmd({ "BufWritePre" }, {
|
autocmd({ "BufWritePre" }, {
|
||||||
group = augroup("auto_create_dir"),
|
group = augroup("auto_create_dir"),
|
||||||
callback = function(event)
|
callback = function(event)
|
||||||
if event.match:match("^%w%w+://") then
|
if event.match:match("^%w%w+://") then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local file = vim.loop.fs_realpath(event.match) or event.match
|
local file = vim.loop.fs_realpath(event.match) or event.match
|
||||||
vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p")
|
vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p")
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
@ -1,166 +1,168 @@
|
|||||||
-- bootstraping
|
-- bootstraping
|
||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
if not vim.loop.fs_stat(lazypath) then
|
if not 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)
|
||||||
|
|
||||||
-- plugins installation and configuration
|
-- plugins installation and configuration
|
||||||
require('lazy').setup({
|
require("lazy").setup({
|
||||||
-- Git plugins
|
-- Git plugins
|
||||||
'tpope/vim-fugitive',
|
"tpope/vim-fugitive",
|
||||||
|
|
||||||
{
|
{
|
||||||
'VonHeikemen/lsp-zero.nvim',
|
"VonHeikemen/lsp-zero.nvim",
|
||||||
branch = 'v3.x',
|
branch = "v3.x",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
-- LSP Support
|
-- LSP Support
|
||||||
{ 'neovim/nvim-lspconfig' },
|
{ "neovim/nvim-lspconfig" },
|
||||||
{ 'williamboman/mason.nvim' },
|
{ "williamboman/mason.nvim" },
|
||||||
{ 'williamboman/mason-lspconfig.nvim' },
|
{ "williamboman/mason-lspconfig.nvim" },
|
||||||
|
|
||||||
-- Autocompletion
|
-- Autocompletion
|
||||||
{ 'hrsh7th/nvim-cmp' },
|
{ "hrsh7th/nvim-cmp" },
|
||||||
{ 'hrsh7th/cmp-buffer' },
|
{ "hrsh7th/cmp-buffer" },
|
||||||
{ 'hrsh7th/cmp-path' },
|
{ "hrsh7th/cmp-path" },
|
||||||
{ 'saadparwaiz1/cmp_luasnip' },
|
{ "saadparwaiz1/cmp_luasnip" },
|
||||||
{ 'hrsh7th/cmp-nvim-lsp' },
|
{ "hrsh7th/cmp-nvim-lsp" },
|
||||||
{ 'hrsh7th/cmp-nvim-lua' },
|
{ "hrsh7th/cmp-nvim-lua" },
|
||||||
|
|
||||||
-- Snippets
|
-- Snippets
|
||||||
{ 'L3MON4D3/LuaSnip' },
|
{ "L3MON4D3/LuaSnip" },
|
||||||
{ 'rafamadriz/friendly-snippets' },
|
{ "rafamadriz/friendly-snippets" },
|
||||||
|
|
||||||
-- Nice lsp info
|
-- Nice lsp info
|
||||||
{ 'j-hui/fidget.nvim', opts = {} },
|
{ "j-hui/fidget.nvim", opts = {} },
|
||||||
|
|
||||||
-- Additional neovim docs
|
-- Additional neovim docs
|
||||||
'folke/neodev.nvim',
|
"folke/neodev.nvim",
|
||||||
opts = {},
|
opts = {},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Emacs which key but in a much nicer form
|
-- Emacs which key but in a much nicer form
|
||||||
{ 'folke/which-key.nvim', opts = {}, event = "VeryLazy" },
|
{ "folke/which-key.nvim", opts = {}, event = "VeryLazy" },
|
||||||
|
|
||||||
{
|
{
|
||||||
-- Adds git related signs to the gutter, as well as utilities for managing changes
|
-- Adds git related signs to the gutter, as well as utilities for managing changes
|
||||||
'lewis6991/gitsigns.nvim',
|
"lewis6991/gitsigns.nvim",
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
-- Catppuccin, the best pastell color scheme
|
-- Catppuccin, the best pastell color scheme
|
||||||
"catppuccin/nvim",
|
"catppuccin/nvim",
|
||||||
name = "catppuccin",
|
name = "catppuccin",
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
-- Set lualine as statusline
|
-- Set lualine as statusline
|
||||||
'nvim-lualine/lualine.nvim',
|
"nvim-lualine/lualine.nvim",
|
||||||
-- See `:help lualine.txt`
|
-- See `:help lualine.txt`
|
||||||
opts = {
|
opts = {
|
||||||
options = {
|
options = {
|
||||||
icons_enabled = false,
|
icons_enabled = false,
|
||||||
theme = 'catppuccin',
|
theme = "catppuccin",
|
||||||
component_separators = '|',
|
component_separators = "|",
|
||||||
section_separators = '',
|
section_separators = "",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
-- show indent line
|
-- show indent line
|
||||||
'lukas-reineke/indent-blankline.nvim',
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
},
|
},
|
||||||
|
|
||||||
-- highlight indentscope
|
-- highlight indentscope
|
||||||
"echasnovski/mini.indentscope",
|
"echasnovski/mini.indentscope",
|
||||||
|
|
||||||
-- "gc" to comment visual regions/lines
|
-- "gc" to comment visual regions/lines
|
||||||
{ 'numToStr/Comment.nvim', opts = {}, event = "VeryLazy" },
|
{ "numToStr/Comment.nvim", opts = {}, event = "VeryLazy" },
|
||||||
|
|
||||||
-- Fuzzy Finder (files, lsp, etc)
|
-- Fuzzy Finder (files, lsp, etc)
|
||||||
{
|
{
|
||||||
'nvim-telescope/telescope.nvim',
|
"nvim-telescope/telescope.nvim",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
dependencies = {
|
dependencies = {
|
||||||
'nvim-lua/plenary.nvim',
|
"nvim-lua/plenary.nvim",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
-- Highlight, edit, and navigate code
|
-- Highlight, edit, and navigate code
|
||||||
'nvim-treesitter/nvim-treesitter',
|
"nvim-treesitter/nvim-treesitter",
|
||||||
build = ':TSUpdate',
|
build = ":TSUpdate",
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
-- netrw on crack
|
-- netrw on crack
|
||||||
'stevearc/oil.nvim',
|
"stevearc/oil.nvim",
|
||||||
opts = {
|
opts = {},
|
||||||
},
|
-- Optional dependencies
|
||||||
-- Optional dependencies
|
dependencies = { "nvim-tree/nvim-web-devicons", lazy = true },
|
||||||
dependencies = { "nvim-tree/nvim-web-devicons", lazy = true },
|
},
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
-- harpoon your way around code
|
-- harpoon your way around code
|
||||||
{
|
{
|
||||||
"ThePrimeagen/harpoon",
|
"ThePrimeagen/harpoon",
|
||||||
branch = "harpoon2",
|
branch = "harpoon2",
|
||||||
requires = { "nvim-lua/plenary.nvim", lazy = true }
|
requires = { "nvim-lua/plenary.nvim", lazy = true },
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
"NvChad/nvim-colorizer.lua",
|
"NvChad/nvim-colorizer.lua",
|
||||||
|
|
||||||
{
|
{
|
||||||
"stevearc/dressing.nvim",
|
"stevearc/dressing.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
opts = {
|
opts = {
|
||||||
input = { default_prompt = "➤ " },
|
input = { default_prompt = "➤ " },
|
||||||
select = { backend = { "telescope", "builtin" } },
|
select = { backend = { "telescope", "builtin" } },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- nice tmux integration
|
-- nice tmux integration
|
||||||
'christoomey/vim-tmux-navigator',
|
"christoomey/vim-tmux-navigator",
|
||||||
|
|
||||||
-- smart autopairs
|
-- smart autopairs
|
||||||
'windwp/nvim-autopairs',
|
"windwp/nvim-autopairs",
|
||||||
|
|
||||||
{
|
{
|
||||||
-- nicer notification's
|
-- nicer notification's
|
||||||
'rcarriga/nvim-notify',
|
"rcarriga/nvim-notify",
|
||||||
config = function()
|
config = function()
|
||||||
vim.notify = require("notify")
|
vim.notify = require("notify")
|
||||||
end
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- markdown editing super powered
|
-- markdown editing super powered
|
||||||
'jakewvincent/mkdnflow.nvim',
|
"jakewvincent/mkdnflow.nvim",
|
||||||
|
|
||||||
|
-- additional formater support
|
||||||
|
"stevearc/conform.nvim",
|
||||||
}, {
|
}, {
|
||||||
install = {
|
install = {
|
||||||
colorscheme = { "catppuccin" }
|
colorscheme = { "catppuccin" },
|
||||||
},
|
},
|
||||||
performance = {
|
performance = {
|
||||||
rtp = {
|
rtp = {
|
||||||
disabled_plugins = {
|
disabled_plugins = {
|
||||||
"gzip",
|
"gzip",
|
||||||
"netrwPlugin",
|
"netrwPlugin",
|
||||||
"tarPlugin",
|
"tarPlugin",
|
||||||
"tohtml",
|
"tohtml",
|
||||||
"tutor",
|
"tutor",
|
||||||
"zipPlugin",
|
"zipPlugin",
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
local map = vim.keymap.set
|
local map = vim.keymap.set
|
||||||
|
|
||||||
-- Leader
|
-- Leader
|
||||||
vim.g.mapleader = ' '
|
vim.g.mapleader = " "
|
||||||
vim.g.maplocalleader = ';'
|
vim.g.maplocalleader = ";"
|
||||||
|
|
||||||
-- Diagnostic keymaps
|
-- Diagnostic keymaps
|
||||||
map('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' })
|
map("n", "[d", vim.diagnostic.goto_prev, { desc = "Go to previous diagnostic message" })
|
||||||
map('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' })
|
map("n", "]d", vim.diagnostic.goto_next, { desc = "Go to next diagnostic message" })
|
||||||
map('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' })
|
map("n", "<leader>e", vim.diagnostic.open_float, { desc = "Open floating diagnostic message" })
|
||||||
map('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })
|
map("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostics list" })
|
||||||
|
|
||||||
-- Lsp format
|
-- Lsp format
|
||||||
map('n', '<leader>f', vim.lsp.buf.format, { desc = "Format current buffer" })
|
-- map('n', '<leader>f', vim.lsp.buf.format, { desc = "Format current buffer" })
|
||||||
|
|
||||||
-- Move text easilly
|
-- Move text easilly
|
||||||
map("v", "J", ":m '>+1<CR>gv=gv", { desc = "Move selected text up" })
|
map("v", "J", ":m '>+1<CR>gv=gv", { desc = "Move selected text up" })
|
||||||
@ -28,7 +28,7 @@ map("x", "<leader>p", [["_dP]], { desc = "Paste while keeping the registry" })
|
|||||||
|
|
||||||
-- source current lua config file
|
-- source current lua config file
|
||||||
map("n", "<leader><leader>", function()
|
map("n", "<leader><leader>", function()
|
||||||
vim.cmd("so")
|
vim.cmd("so")
|
||||||
end, { desc = "Source current source file" })
|
end, { desc = "Source current source file" })
|
||||||
|
|
||||||
-- better indenting
|
-- better indenting
|
||||||
|
@ -18,7 +18,7 @@ opt.expandtab = true
|
|||||||
opt.smartindent = true
|
opt.smartindent = true
|
||||||
|
|
||||||
-- Enable the mouse, just to have it
|
-- Enable the mouse, just to have it
|
||||||
opt.mouse = 'a'
|
opt.mouse = "a"
|
||||||
|
|
||||||
-- Enable break indent
|
-- Enable break indent
|
||||||
opt.breakindent = true
|
opt.breakindent = true
|
||||||
@ -34,14 +34,14 @@ opt.ignorecase = true
|
|||||||
opt.smartcase = true
|
opt.smartcase = true
|
||||||
|
|
||||||
-- Keep signcolumn on by default
|
-- Keep signcolumn on by default
|
||||||
opt.signcolumn = 'yes'
|
opt.signcolumn = "yes"
|
||||||
|
|
||||||
-- Decrease update time
|
-- Decrease update time
|
||||||
opt.updatetime = 50
|
opt.updatetime = 50
|
||||||
opt.timeoutlen = 300
|
opt.timeoutlen = 300
|
||||||
|
|
||||||
-- Set completeopt to have a better completion experience
|
-- Set completeopt to have a better completion experience
|
||||||
opt.completeopt = 'menuone,noselect'
|
opt.completeopt = "menuone,noselect"
|
||||||
|
|
||||||
-- Enable true color support
|
-- Enable true color support
|
||||||
opt.termguicolors = true
|
opt.termguicolors = true
|
||||||
|
Loading…
Reference in New Issue
Block a user