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>x', '"_x', { remap = false })
dr_map('n', '<leader>r', '"_viwP', { 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 -- 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('.'), repeat([''], v:count1))<cr>", { remap = false })
map('n', '<leader>O', ":<c-u>call append(line('.')-1, 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 -- Rust tools
{ {
"mrcjkb/rustaceanvim", "mrcjkb/rustaceanvim",
version = "^4", version = "^6",
ft = { "rust" }, lazy = false,
}, },
-- Automatically add bracket pairs -- Automatically add bracket pairs
"windwp/nvim-autopairs", "windwp/nvim-autopairs",

View file

@ -1,27 +1,6 @@
local lspconfig = require('lspconfig') local lspconfig = require('lspconfig')
local map = vim.keymap.set 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 -- ;k to hover
-- ;a to show code actions -- ;a to show code actions
-- ;d to show diagnostic message -- ;d to show diagnostic message
@ -37,10 +16,53 @@ vim.api.nvim_create_autocmd("LspAttach", {
end, end,
}) })
-- Enable inlay hints for Rust -- Python
vim.api.nvim_create_autocmd("LspAttach", { lspconfig.ruff.setup({
pattern = "*.rs", init_options = {
callback = function() settings = {
vim.lsp.inlay_hint.enable(true) lineLength = 100,
end, }
}
}) })
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 -- Use the moonfly colorscheme
vim.cmd [[colorscheme moonfly]] vim.cmd [[colorscheme moonfly]]

View file

@ -1,19 +1,19 @@
vim.g.rustaceanvim = { vim.g.rustaceanvim = {
-- Plugin configuration -- Plugin configuration
tools = { tools = {
enable_clippy = true,
}, },
-- LSP configuration
server = { server = {
default_settings = { on_attach = function()
-- rust-analyzer language server configuration vim.lsp.inlay_hint.enable(true)
["rust-analyzer"] = { end
check = { }
command = "clippy"
}
},
},
},
-- DAP configuration
dap = {
},
} }
-- 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>x', '"_x', { remap = false })
dr_map('n', '<leader>r', '"_viwP', { 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 -- 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('.'), repeat([''], v:count1))<cr>", { remap = false })
map('n', '<leader>O', ":<c-u>call append(line('.')-1, 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>x', '"_x', { remap = false })
dr_map('n', '<leader>r', '"_viwP', { 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 -- 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('.'), repeat([''], v:count1))<cr>", { remap = false })
map('n', '<leader>O', ":<c-u>call append(line('.')-1, 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>x', '"_x', { remap = false })
dr_map('n', '<leader>r', '"_viwP', { 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 -- 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('.'), repeat([''], v:count1))<cr>", { remap = false })
map('n', '<leader>O', ":<c-u>call append(line('.')-1, repeat([''], v:count1))<cr>", { remap = false }) map('n', '<leader>O', ":<c-u>call append(line('.')-1, repeat([''], v:count1))<cr>", { remap = false })