✨ personal changes
This commit is contained in:
@@ -28,12 +28,40 @@ require("lazy").setup({
|
|||||||
{ import = "plugins" },
|
{ import = "plugins" },
|
||||||
}, lazy_config)
|
}, lazy_config)
|
||||||
|
|
||||||
|
-- load plugins manually
|
||||||
|
require("neogit").setup{}
|
||||||
|
require("gitmoji").setup({})
|
||||||
|
|
||||||
-- load theme
|
-- load theme
|
||||||
dofile(vim.g.base46_cache .. "defaults")
|
dofile(vim.g.base46_cache .. "defaults")
|
||||||
dofile(vim.g.base46_cache .. "statusline")
|
dofile(vim.g.base46_cache .. "statusline")
|
||||||
|
|
||||||
require "nvchad.autocmds"
|
require "nvchad.autocmds"
|
||||||
|
|
||||||
|
-- shell
|
||||||
|
vim.opt.shell = "/bin/fish"
|
||||||
|
|
||||||
|
-- Disable inline diagnostics (virtual text)
|
||||||
|
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
|
||||||
|
vim.lsp.diagnostic.on_publish_diagnostics, {
|
||||||
|
virtual_text = false,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
-- Function to show diagnostics in a floating window on hover
|
||||||
|
local function show_diagnostics_on_hover()
|
||||||
|
local opts = {
|
||||||
|
focusable = false,
|
||||||
|
close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" },
|
||||||
|
border = 'rounded',
|
||||||
|
source = 'always',
|
||||||
|
prefix = ' ',
|
||||||
|
}
|
||||||
|
vim.api.nvim_command('autocmd CursorHold * lua vim.diagnostic.open_float(nil, ' .. vim.inspect(opts) .. ')')
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Call the function to set up the autocmd
|
||||||
|
show_diagnostics_on_hover()
|
||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
require "mappings"
|
require "mappings"
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
local options = {
|
local options = {
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
lua = { "stylua" },
|
lua = { "stylua" },
|
||||||
-- css = { "prettier" },
|
python = { "black" },
|
||||||
-- html = { "prettier" },
|
css = { "prettier" },
|
||||||
|
html = { "prettier" },
|
||||||
},
|
},
|
||||||
|
|
||||||
-- format_on_save = {
|
-- format_on_save = {
|
||||||
|
|||||||
@@ -21,3 +21,32 @@ lspconfig.tsserver.setup {
|
|||||||
on_init = on_init,
|
on_init = on_init,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- python
|
||||||
|
lspconfig.basedpyright.setup{
|
||||||
|
on_attach = on_attach,
|
||||||
|
on_init = on_init,
|
||||||
|
capabilities = capabilities,
|
||||||
|
filetypes = { "python" },
|
||||||
|
settings = {
|
||||||
|
basedpyright = {
|
||||||
|
typeCheckingMode = "standard",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
---- ruff_lsp and pyright compatibility
|
||||||
|
local on_attach = function(client, bufnr)
|
||||||
|
if client.name == 'ruff_lsp' then
|
||||||
|
-- hover in favor of Pyright
|
||||||
|
client.server_capabilities.hoverProvider = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
lspconfig.ruff_lsp.setup{
|
||||||
|
on_attach = on_attach,
|
||||||
|
on_init = on_init,
|
||||||
|
capabilities = capabilities,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,5 +6,8 @@ local map = vim.keymap.set
|
|||||||
|
|
||||||
map("n", ";", ":", { desc = "CMD enter command mode" })
|
map("n", ";", ":", { desc = "CMD enter command mode" })
|
||||||
map("i", "jk", "<ESC>")
|
map("i", "jk", "<ESC>")
|
||||||
|
map("n", "<leader>gh", ":Neogit <cr>")
|
||||||
|
map("n", "<leader>gm", ":Gitmoji <cr>")
|
||||||
|
|
||||||
|
|
||||||
-- map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>")
|
-- map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>")
|
||||||
|
|||||||
+2
-1
@@ -1,6 +1,7 @@
|
|||||||
require "nvchad.options"
|
require "nvchad.options"
|
||||||
|
|
||||||
-- add yours here!
|
-- add yours here!
|
||||||
|
vim.opt.foldmethod = "expr"
|
||||||
|
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||||
-- local o = vim.o
|
-- local o = vim.o
|
||||||
-- o.cursorlineopt ='both' -- to enable cursorline!
|
-- o.cursorlineopt ='both' -- to enable cursorline!
|
||||||
|
|||||||
+73
-28
@@ -7,32 +7,77 @@ return {
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- These are some examples, uncomment them if you want to see them work!
|
{
|
||||||
-- {
|
"neovim/nvim-lspconfig",
|
||||||
-- "neovim/nvim-lspconfig",
|
config = function()
|
||||||
-- config = function()
|
require("nvchad.configs.lspconfig").defaults()
|
||||||
-- require("nvchad.configs.lspconfig").defaults()
|
require "configs.lspconfig"
|
||||||
-- require "configs.lspconfig"
|
end,
|
||||||
-- end,
|
},
|
||||||
-- },
|
|
||||||
--
|
{
|
||||||
-- {
|
"williamboman/mason.nvim",
|
||||||
-- "williamboman/mason.nvim",
|
opts = {
|
||||||
-- opts = {
|
ensure_installed = {
|
||||||
-- ensure_installed = {
|
"lua-language-server",
|
||||||
-- "lua-language-server", "stylua",
|
"stylua",
|
||||||
-- "html-lsp", "css-lsp" , "prettier"
|
"html-lsp",
|
||||||
-- },
|
"css-lsp",
|
||||||
-- },
|
"prettier",
|
||||||
-- },
|
"basedpyright",
|
||||||
--
|
"mypy",
|
||||||
-- {
|
"black",
|
||||||
-- "nvim-treesitter/nvim-treesitter",
|
"ruff-lsp",
|
||||||
-- opts = {
|
},
|
||||||
-- ensure_installed = {
|
},
|
||||||
-- "vim", "lua", "vimdoc",
|
},
|
||||||
-- "html", "css"
|
|
||||||
-- },
|
{
|
||||||
-- },
|
"nvim-treesitter/nvim-treesitter",
|
||||||
-- },
|
opts = {
|
||||||
|
ensure_installed = {
|
||||||
|
"vim",
|
||||||
|
"lua",
|
||||||
|
"vimdoc",
|
||||||
|
"html",
|
||||||
|
"css",
|
||||||
|
"python",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"NeogitOrg/neogit",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
},
|
||||||
|
config = true,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"kylechui/nvim-surround",
|
||||||
|
version = "*", -- Use for stability; omit to use `main` branch for the latest features
|
||||||
|
event = "VeryLazy",
|
||||||
|
config = function()
|
||||||
|
require("nvim-surround").setup {
|
||||||
|
-- Configuration here, or leave empty to use defaults
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"Dynge/gitmoji.nvim",
|
||||||
|
dependencies = {
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
filetypes = { "gitcommit" },
|
||||||
|
completion = {
|
||||||
|
append_space = false,
|
||||||
|
complete_as = "emoji",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
ft = "gitcommit",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user