Compare commits
11 Commits
1a2d03d2c9
...
deprecated
| Author | SHA1 | Date | |
|---|---|---|---|
| 83d958ba47 | |||
| 4123a4752c | |||
| 2a58ee17e7 | |||
| 6bcb31995a | |||
| 1ce80bf79e | |||
| 5f48a96e8c | |||
| f2e889b1d1 | |||
| fde5adbe71 | |||
| 5e73c24fdd | |||
| 44a0ad24f1 | |||
| 6fe552e3dc |
@@ -29,14 +29,7 @@ require("lazy").setup({
|
||||
}, lazy_config)
|
||||
|
||||
-- load plugins' setup
|
||||
require("neogit").setup{}
|
||||
require("gitmoji").setup({})
|
||||
require("todo-comments").setup({})
|
||||
-- require("cmp").setup({
|
||||
-- sources = {
|
||||
-- { name = 'gitmoji' }
|
||||
-- }
|
||||
-- })
|
||||
|
||||
-- load theme
|
||||
dofile(vim.g.base46_cache .. "defaults")
|
||||
@@ -72,3 +65,32 @@ show_diagnostics_on_hover()
|
||||
vim.schedule(function()
|
||||
require "mappings"
|
||||
end)
|
||||
|
||||
-- enables remote clipboard
|
||||
-- vim.g.clipboard = {
|
||||
-- name = 'OSC 52',
|
||||
-- copy = {
|
||||
-- ['+'] = require('vim.ui.clipboard.osc52').copy('+'),
|
||||
-- ['*'] = require('vim.ui.clipboard.osc52').copy('*'),
|
||||
-- },
|
||||
-- paste = {
|
||||
-- ['+'] = require('vim.ui.clipboard.osc52').paste('+'),
|
||||
-- ['*'] = require('vim.ui.clipboard.osc52').paste('*'),
|
||||
-- },
|
||||
-- }
|
||||
|
||||
-- Ruff and pyright cross-compatibility
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup('lsp_attach_disable_ruff_hover', { clear = true }),
|
||||
callback = function(args)
|
||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
if client == nil then
|
||||
return
|
||||
end
|
||||
if client.name == 'ruff' then
|
||||
-- Disable hover in favor of Pyright
|
||||
client.server_capabilities.hoverProvider = false
|
||||
end
|
||||
end,
|
||||
desc = 'LSP: Disable hover capability from Ruff',
|
||||
})
|
||||
|
||||
+2
-1
@@ -5,7 +5,8 @@
|
||||
local M = {}
|
||||
|
||||
M.ui = {
|
||||
theme = "nightowl",
|
||||
-- theme = "nightowl",
|
||||
theme = "decay",
|
||||
transparency = true,
|
||||
statusline = {
|
||||
theme = "minimal",
|
||||
|
||||
@@ -4,6 +4,10 @@ local options = {
|
||||
python = { "black" },
|
||||
css = { "prettier" },
|
||||
html = { "prettier" },
|
||||
go = { "goimports", "gofmt" },
|
||||
bash = {"beautysh"},
|
||||
sh = {"beautysh"},
|
||||
zsh = {"beautysh"},
|
||||
},
|
||||
|
||||
-- format_on_save = {
|
||||
|
||||
@@ -5,6 +5,7 @@ local capabilities = require("nvchad.configs.lspconfig").capabilities
|
||||
|
||||
local lspconfig = require "lspconfig"
|
||||
local servers = { "html", "cssls", "clangd" }
|
||||
local util = require "lspconfig/util"
|
||||
|
||||
-- lsps with default config
|
||||
for _, lsp in ipairs(servers) do
|
||||
@@ -16,7 +17,7 @@ for _, lsp in ipairs(servers) do
|
||||
end
|
||||
|
||||
-- typescript
|
||||
lspconfig.tsserver.setup {
|
||||
lspconfig.ts_ls.setup {
|
||||
on_attach = on_attach,
|
||||
on_init = on_init,
|
||||
capabilities = capabilities,
|
||||
@@ -35,18 +36,41 @@ lspconfig.basedpyright.setup{
|
||||
}
|
||||
}
|
||||
|
||||
---- 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.gopls.setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
cmd = {"gopls"},
|
||||
filetypes = { "go", "gomod", "gowork", "gotmpl" },
|
||||
root_dir = util.root_pattern("go.work", "go.mod", ".git"),
|
||||
settings = {
|
||||
gopls = {
|
||||
completeUnimported = true,
|
||||
usePlaceholders = true,
|
||||
analyses = {
|
||||
unusedParameters = true,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lspconfig.ruff_lsp.setup{
|
||||
---- 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.setup{
|
||||
on_attach = on_attach,
|
||||
on_init = on_init,
|
||||
capabilities = capabilities,
|
||||
init_options = {
|
||||
settings = {
|
||||
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
vim.keymap.set("n", "<leader>a", function()
|
||||
vim.cmd.RustLsp "codeAction" -- supports rust-analyzer's grouping
|
||||
-- or vim.lsp.buf.codeAction() if you don't want grouping.
|
||||
end, { silent = true, buffer = bufnr })
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"K", -- Override Neovim's built-in hover keymap with rustaceanvim's hover actions
|
||||
function()
|
||||
vim.cmd.RustLsp { "hover", "actions" }
|
||||
end,
|
||||
{ silent = true, buffer = bufnr }
|
||||
)
|
||||
+4
-1
@@ -3,13 +3,16 @@ require "nvchad.mappings"
|
||||
-- add yours here
|
||||
|
||||
local map = vim.keymap.set
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
|
||||
map("n", ";", ":", { desc = "CMD enter command mode" })
|
||||
map("i", "jk", "<ESC>")
|
||||
map("n", "<leader>gh", ":Neogit <cr>")
|
||||
-- map("n", "<leader>gh", ":Neogit <cr>")
|
||||
map("n", "<leader>md", ":MarkdownPreviewToggle <cr>")
|
||||
map("n", "<leader>tl", ":TodoLocList <cr>")
|
||||
map("n", "<leader>td", ":TodoQuickFix <cr>")
|
||||
map("n", "<leader>cr", ":!python3 % <cr>")
|
||||
|
||||
|
||||
|
||||
-- map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>")
|
||||
|
||||
+35
-36
@@ -24,14 +24,11 @@ return {
|
||||
"html-lsp",
|
||||
"css-lsp",
|
||||
"prettier",
|
||||
"basedpyright",
|
||||
"mypy",
|
||||
"black",
|
||||
"ruff-lsp",
|
||||
"basedpyright", "mypy", "black", "ruff-lsp",
|
||||
"goimports", "gofumpt", "gomodifytags", "impl", "delve",
|
||||
"typescript-language-server",
|
||||
"clangd",
|
||||
},
|
||||
automatic_installation = true,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -45,20 +42,15 @@ return {
|
||||
"html",
|
||||
"css",
|
||||
"python",
|
||||
"typescript"
|
||||
"typescript",
|
||||
"go",
|
||||
"gomod",
|
||||
"gowork",
|
||||
"gosum",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"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
|
||||
@@ -68,21 +60,6 @@ return {
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"Dynge/gitmoji.nvim",
|
||||
dependencies = {
|
||||
"hrsh7th/nvim-cmp",
|
||||
},
|
||||
opts = {
|
||||
filetypes = { "gitcommit", "NeogitCommitMessage" },
|
||||
completion = {
|
||||
append_space = false,
|
||||
complete_as = "emoji",
|
||||
},
|
||||
},
|
||||
ft = "gitcommit"
|
||||
},
|
||||
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
||||
@@ -100,12 +77,12 @@ return {
|
||||
},
|
||||
|
||||
{
|
||||
'nvimdev/dashboard-nvim',
|
||||
event = 'VimEnter',
|
||||
config = function()
|
||||
require "configs.dashboard"
|
||||
end,
|
||||
dependencies = { {'nvim-tree/nvim-web-devicons'}}
|
||||
'nvimdev/dashboard-nvim',
|
||||
event = 'VimEnter',
|
||||
config = function()
|
||||
require "configs.dashboard"
|
||||
end,
|
||||
dependencies = { {'nvim-tree/nvim-web-devicons'}}
|
||||
},
|
||||
|
||||
-- {
|
||||
@@ -137,4 +114,26 @@ return {
|
||||
opts = {}
|
||||
},
|
||||
|
||||
{
|
||||
"kdheepak/lazygit.nvim",
|
||||
cmd = {
|
||||
"LazyGit",
|
||||
"LazyGitConfig",
|
||||
"LazyGitCurrentFile",
|
||||
"LazyGitFilter",
|
||||
"LazyGitFilterCurrentFile",
|
||||
},
|
||||
-- optional for floating window border decoration
|
||||
dependencies = { "nvim-lua/plenary.nvim", },
|
||||
-- setting the keybinding for LazyGit with 'keys' is recommended in
|
||||
-- order to load the plugin when the command is run for the first time
|
||||
keys = {
|
||||
{ "<leader>lg", "<cmd>LazyGit<cr>", desc = "LazyGit" }
|
||||
}
|
||||
},
|
||||
{
|
||||
'mrcjkb/rustaceanvim',
|
||||
version = '^6', -- Recommended
|
||||
lazy = false, -- This plugin is already lazy
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user