Compare commits
16 Commits
e61da45d1e
...
deprecated
| Author | SHA1 | Date | |
|---|---|---|---|
| 83d958ba47 | |||
| 4123a4752c | |||
| 2a58ee17e7 | |||
| 6bcb31995a | |||
| 1ce80bf79e | |||
| 5f48a96e8c | |||
| f2e889b1d1 | |||
| fde5adbe71 | |||
| 5e73c24fdd | |||
| 44a0ad24f1 | |||
| 6fe552e3dc | |||
| 1a2d03d2c9 | |||
| c8dfbf8aee | |||
| d6905f2052 | |||
| 3beba645ef | |||
| 5fe351bbe1 |
@@ -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 = "bearded-arc",
|
||||
-- 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 }
|
||||
)
|
||||
+6
-1
@@ -3,11 +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>")
|
||||
|
||||
+60
-65
@@ -24,10 +24,8 @@ 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",
|
||||
},
|
||||
@@ -44,45 +42,24 @@ return {
|
||||
"html",
|
||||
"css",
|
||||
"python",
|
||||
"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
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("nvim-surround").setup {
|
||||
-- Configuration here, or leave empty to use defaults
|
||||
}
|
||||
require("nvim-surround").setup{}
|
||||
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,45 +77,63 @@ 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'}}
|
||||
},
|
||||
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
tag = "0.1.5",
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'jonarrien/telescope-cmdline.nvim',
|
||||
},
|
||||
keys = {
|
||||
{ ':', '<cmd>Telescope cmdline<cr>', desc = 'Cmdline' }
|
||||
},
|
||||
opts = {
|
||||
...,
|
||||
extensions = {
|
||||
cmdline = {
|
||||
},
|
||||
},
|
||||
...
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("telescope").setup(opts)
|
||||
require("telescope").load_extension('cmdline')
|
||||
end,
|
||||
},
|
||||
-- {
|
||||
-- "nvim-telescope/telescope.nvim",
|
||||
-- tag = "0.1.5",
|
||||
-- dependencies = {
|
||||
-- 'nvim-lua/plenary.nvim',
|
||||
-- 'jonarrien/telescope-cmdline.nvim',
|
||||
-- },
|
||||
-- keys = {
|
||||
-- { ':', '<cmd>Telescope cmdline<cr>', desc = 'Cmdline' }
|
||||
-- },
|
||||
-- opts = {
|
||||
-- ...,
|
||||
-- extensions = {
|
||||
-- cmdline = {
|
||||
-- },
|
||||
-- },
|
||||
-- ...
|
||||
-- },
|
||||
-- config = function(_, opts)
|
||||
-- require("telescope").setup(opts)
|
||||
-- require("telescope").load_extension('cmdline')
|
||||
-- end,
|
||||
-- },
|
||||
{
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
}
|
||||
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