Skip to content

Instantly share code, notes, and snippets.

@CristaLCorp
Last active March 1, 2024 13:32
Show Gist options
  • Save CristaLCorp/ffccba64c8abc5e3e7d6f05005050629 to your computer and use it in GitHub Desktop.
Save CristaLCorp/ffccba64c8abc5e3e7d6f05005050629 to your computer and use it in GitHub Desktop.
NVIM
---@type ChadrcConfig
local M = {}
M.ui = { theme = 'onedark' }
M.plugins = 'custom.plugins'
M.mappings = require "custom.mappings"
vim.wo.relativenumber = true
return M
local config = require("plugins.configs.lspconfig")
local on_attach = config.on_attach
local capabilities = config.capabilities
local lspconfig = require("lspconfig")
lspconfig.pyright.setup({
on_attach = on_attach,
capabilities = capabilities,
filetypes = {"python"},
})
lspconfig.rust_analyzer.setup({
on_attach = on_attach,
capabilities = capabilities,
filetypes = {"rust"},
root_dir = lspconfig.util.root_pattern("Cargo.toml")
})
---@type MappingsTable
local M = {}
-- changing the navigation key binding
M.general = {
n = {
["<C-h>"] = { "<cmd> TmuxNavigateLeft<CR>", "window left" },
["<C-l>"] = { "<cmd> TmuxNavigateRight<CR>", "window right" },
["<C-j>"] = { "<cmd> TmuxNavigateDown<CR>", "window down" },
["<C-k>"] = { "<cmd> TmuxNavigateUp<CR>", "window up" }
},
}
-- changing comment key binding
M.comment = {
plugin = true,
-- toggle comment in both modes
n = {
["<leader>:"] = {
function()
require("Comment.api").toggle.linewise.current()
end,
"Toggle comment",
},
},
v = {
["<leader>:"] = {
"<ESC><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<CR>",
"Toggle comment",
},
},
}
return M
local plugins = {
{
"christoomey/vim-tmux-navigator",
lazy = false
},
{
"ThePrimeagen/vim-be-good",
lazy = false
},
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"pyright",
},
},
},
{
"neovim/nvim-lspconfig",
config = function()
require "plugins.configs.lspconfig"
require "custom.configs.lspconfig"
end,
},
}
return plugins
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment