Files
neovim-config/init.lua
2026-07-14 22:17:15 -05:00

64 lines
1.4 KiB
Lua

vim.cmd("set ww=<,>,[,],h,l")
vim.cmd("colorscheme slate")
vim.cmd("set linebreak")
vim.cmd("set number")
vim.cmd("set ruler")
vim.cmd("set expandtab")
vim.cmd("set shiftwidth=4 smarttab")
-- writing mode for markdown files
vim.api.nvim_create_autocmd("FileType", {
pattern = { "markdown", "text", "tex" },
callback = function()
vim.opt_local.spell = true
vim.keymap.set("n", "j", "gj", { buffer = true })
vim.keymap.set("n", "k", "gk", { buffer = true })
end,
})
vim.deprecate = function() end
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
-- Better syntax highlighting
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
},
-- Easy LSP config (works with pyright)
{
"neovim/nvim-lspconfig",
},
})
local lspconfig = require("lspconfig")
lspconfig.pyright.setup({})
require("nvim-treesitter.configs").setup({
auto_install = true,
highlight = {
enable = true,
},
})
vim.keymap.set('n', ' ', vim.lsp.buf.hover, {})
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, {})
vim.keymap.set('n', 'cd', vim.lsp.buf.rename, {})
vim.keymap.set('n', 'g.', vim.lsp.buf.code_action, {})
vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float)