chg: Some moving of stuff and added ,yy for clipboard copy

This commit is contained in:
Sayantan Santra 2025-04-24 20:16:58 -05:00
parent 52cbe91e75
commit 47840ea0fd
Signed by: SinTan1729
GPG key ID: 0538DD402EA50898
8 changed files with 76 additions and 43 deletions

View file

@ -30,6 +30,9 @@ dr_map('n', '<leader>D', '"_D', { remap = false })
dr_map('n', '<leader>x', '"_x', { remap = false })
dr_map('n', '<leader>r', '"_viwP', { remap = false })
-- Use ,yy for yanking to system clipboard
map('n', '<leader>y', '"+y', { remap = false })
-- Insert a newline in normal mode by ,o and ,O
map('n', '<leader>o', ":<c-u>call append(line('.'), repeat([''], v:count1))<cr>", { remap = false })
map('n', '<leader>O', ":<c-u>call append(line('.')-1, repeat([''], v:count1))<cr>", { remap = false })

View file

@ -64,8 +64,8 @@ require("lazy").setup({
-- Rust tools
{
"mrcjkb/rustaceanvim",
version = "^4",
ft = { "rust" },
version = "^6",
lazy = false,
},
-- Automatically add bracket pairs
"windwp/nvim-autopairs",

View file

@ -1,27 +1,6 @@
local lspconfig = require('lspconfig')
local map = vim.keymap.set
lspconfig.ruff.setup({
init_options = {
settings = {
lineLength = 100,
}
}
})
lspconfig.lua_ls.setup({
settings = {
Lua = {
diagnostics = { globals = { 'vim' } },
telemetry = { enable = false },
},
}
})
lspconfig.ocamllsp.setup {}
lspconfig.hls.setup {}
-- ;k to hover
-- ;a to show code actions
-- ;d to show diagnostic message
@ -37,10 +16,53 @@ vim.api.nvim_create_autocmd("LspAttach", {
end,
})
-- Enable inlay hints for Rust
vim.api.nvim_create_autocmd("LspAttach", {
pattern = "*.rs",
callback = function()
vim.lsp.inlay_hint.enable(true)
end,
-- Python
lspconfig.ruff.setup({
init_options = {
settings = {
lineLength = 100,
}
}
})
lspconfig.pyright.setup {
settings = {
pyright = {
-- Using Ruff's import organizer
disableOrganizeImports = true,
},
python = {
analysis = {
-- Ignore all files for analysis to exclusively use Ruff for linting
ignore = { '*' },
},
},
},
}
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',
})
-- Misc
lspconfig.lua_ls.setup({
settings = {
Lua = {
diagnostics = { globals = { 'vim' } },
telemetry = { enable = false },
},
}
})
lspconfig.ocamllsp.setup {}
lspconfig.hls.setup {}

View file

@ -23,4 +23,3 @@ vim.g.moonflyVirtualTextColor = true
-- Use the moonfly colorscheme
vim.cmd [[colorscheme moonfly]]

View file

@ -1,19 +1,19 @@
vim.g.rustaceanvim = {
-- Plugin configuration
tools = {
enable_clippy = true,
},
-- LSP configuration
server = {
default_settings = {
-- rust-analyzer language server configuration
["rust-analyzer"] = {
check = {
command = "clippy"
}
},
},
},
-- DAP configuration
dap = {
},
on_attach = function()
vim.lsp.inlay_hint.enable(true)
end
}
}
-- Enable inlay hints for Rust
-- vim.api.nvim_create_autocmd("LspAttach", {
-- pattern = "*.rs",
-- callback = function()
-- vim.lsp.inlay_hint.enable(true)
-- end,
-- })

View file

@ -81,6 +81,9 @@ dr_map('n', '<leader>D', '"_D', { remap = false })
dr_map('n', '<leader>x', '"_x', { remap = false })
dr_map('n', '<leader>r', '"_viwP', { remap = false })
-- Use ,yy for yanking to system clipboard
map('n', '<leader>y', '"+y', { remap = false })
-- Insert a newline in normal mode by ,o and ,O
map('n', '<leader>o', ":<c-u>call append(line('.'), repeat([''], v:count1))<cr>", { remap = false })
map('n', '<leader>O', ":<c-u>call append(line('.')-1, repeat([''], v:count1))<cr>", { remap = false })

View file

@ -24,6 +24,9 @@ dr_map('n', '<leader>D', '"_D', { remap = false })
dr_map('n', '<leader>x', '"_x', { remap = false })
dr_map('n', '<leader>r', '"_viwP', { remap = false })
-- Use ,yy for yanking to system clipboard
map('n', '<leader>y', '"+y', { remap = false })
-- Insert a newline in normal mode by ,o and ,O
map('n', '<leader>o', ":<c-u>call append(line('.'), repeat([''], v:count1))<cr>", { remap = false })
map('n', '<leader>O', ":<c-u>call append(line('.')-1, repeat([''], v:count1))<cr>", { remap = false })

View file

@ -24,6 +24,9 @@ dr_map('n', '<leader>D', '"_D', { remap = false })
dr_map('n', '<leader>x', '"_x', { remap = false })
dr_map('n', '<leader>r', '"_viwP', { remap = false })
-- Use ,yy for yanking to system clipboard
map('n', '<leader>y', '"+y', { remap = false })
-- Insert a newline in normal mode by ,o and ,O
map('n', '<leader>o', ":<c-u>call append(line('.'), repeat([''], v:count1))<cr>", { remap = false })
map('n', '<leader>O', ":<c-u>call append(line('.')-1, repeat([''], v:count1))<cr>", { remap = false })