personal changes

This commit is contained in:
Sakamoto Hiroshi
2024-06-22 13:10:22 -05:00
parent aad624221a
commit 70167bf1c8
6 changed files with 138 additions and 31 deletions
+28
View File
@@ -28,12 +28,40 @@ require("lazy").setup({
{ import = "plugins" },
}, lazy_config)
-- load plugins manually
require("neogit").setup{}
require("gitmoji").setup({})
-- load theme
dofile(vim.g.base46_cache .. "defaults")
dofile(vim.g.base46_cache .. "statusline")
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()
require "mappings"
end)
+3 -2
View File
@@ -1,8 +1,9 @@
local options = {
formatters_by_ft = {
lua = { "stylua" },
-- css = { "prettier" },
-- html = { "prettier" },
python = { "black" },
css = { "prettier" },
html = { "prettier" },
},
-- format_on_save = {
+29
View File
@@ -21,3 +21,32 @@ lspconfig.tsserver.setup {
on_init = on_init,
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,
}
+3
View File
@@ -6,5 +6,8 @@ local map = vim.keymap.set
map("n", ";", ":", { desc = "CMD enter command mode" })
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>")
+2 -1
View File
@@ -1,6 +1,7 @@
require "nvchad.options"
-- add yours here!
vim.opt.foldmethod = "expr"
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
-- local o = vim.o
-- o.cursorlineopt ='both' -- to enable cursorline!
+73 -28
View File
@@ -7,32 +7,77 @@ return {
end,
},
-- These are some examples, uncomment them if you want to see them work!
-- {
-- "neovim/nvim-lspconfig",
-- config = function()
-- require("nvchad.configs.lspconfig").defaults()
-- require "configs.lspconfig"
-- end,
-- },
--
-- {
-- "williamboman/mason.nvim",
-- opts = {
-- ensure_installed = {
-- "lua-language-server", "stylua",
-- "html-lsp", "css-lsp" , "prettier"
-- },
-- },
-- },
--
-- {
-- "nvim-treesitter/nvim-treesitter",
-- opts = {
-- ensure_installed = {
-- "vim", "lua", "vimdoc",
-- "html", "css"
-- },
-- },
-- },
{
"neovim/nvim-lspconfig",
config = function()
require("nvchad.configs.lspconfig").defaults()
require "configs.lspconfig"
end,
},
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"lua-language-server",
"stylua",
"html-lsp",
"css-lsp",
"prettier",
"basedpyright",
"mypy",
"black",
"ruff-lsp",
},
},
},
{
"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",
},
}